110,533
社区成员
发帖
与我相关
我的任务
分享
DataSet ds = new DataSet();
string connectionString = "Data Source=ZXY-PC;Initial Catalog=book;User ID=sa;password=sa;Integrated Security=False";
string sql = string.Format("select ID,NAME from book where NAME={0}", textBox1.Text.Trim());
SqlDataAdapter data = new SqlDataAdapter(sql, connectionString);
data.Fill(ds,"book" );
dataGridView1.DataSource = ds.Tables["book"];