日期:2014-05-17 浏览次数:20484 次
string constr = ConfigurationManager.ConnectionStrings["constr"].ToString();
string comstr = "Select * From UserInfo";
SqlDataAdapter adapter = new SqlDataAdapter(comstr, constr);
ds = new DataSet();
DataColumn[] dc = new DataColumn[1];
adapter.Fill(ds);
dc[0] = ds.Tables[0].Columns[0];
ds.Tables[0].PrimaryKey = dc;