1.查询
//1.找一把钥匙
string key = @"Data Source=.;Initial Catalog=dbbook;Integrated Security=True";
//2.铺一条路
SqlConnection sc = new SqlConnection(key);
try{ //3.确定货物 (只能选一个)
string sql = "select * from 表1"; //查全部
string sql = "select * from 表1 where 条件列 like '%"+条件列的值+"%' ";//模糊
string sql = "select 列1,列2 from 表1,表2 where 表1.外键=表2.主键";//2表
//4.弄一辆车
SqlDataAdapter sda = new SqlDataAdapter(sql, sc);
//5.找一个临时仓库
DataSet ds = new DataSet();
//6.货物存到临时仓库
sda.Fill(ds, "ds.Tables[0]");
//7.从临时仓库取出货物到目标