查询方法
string name = this.cobnianji.Text.Trim();
DataTable dt = new DataTable();
string sql = string.Format("SELECT[xingming], [nianji],[xuehao]FROM [dbo].[123] where[xingming]='{0}'", name);
SqlDataAdapter ds = new SqlDataAdapter(sql, DBHelpercs.StrConn);
ds.Fill(dt);
this.jk.DataSource = dt;
连表联查代码 :SELECT[Brand],[Type],[price],[size] ,[Weight] ,[Style] FROM [dbo].[MobileInfo],[dbo].[MobileBrand] where Brand='{0}'