标签:sql cat user tab pen connect str init open
string count = "Data Source=.;Initial Catalog=123;User ID=sa;pwd=123456";
SqlConnection conn = new SqlConnection(count);
conn.Open();
DataTable da = new DataTable();
string sql = "SELECT [xingming] ,[xuehao] FROM [dbo].[456]";
SqlDataAdapter dt = new SqlDataAdapter(sql, conn);
dt.Fill(da);
this.comboBox1.ValueMember = "xuehao";
this.comboBox1.DisplayMember = "xingming";
this.comboBox1.DataSource = da;
标签:sql cat user tab pen connect str init open
原文地址:http://www.cnblogs.com/wangyuxin123/p/7748059.html