SqlConnection ct= new SqlConnection(ConfigurationManager.AppSettings["SqlServerConnectionString"].ToString());
string sql = "select name from table";
DataTable tb = new DataTable();
ct.Open();
SqlDataAdapter sdap = new SqlDataAdapter(sql, lj);
sdap.Fill(tb);
ct.Close();
将sql语句置入DataTable中
最新推荐文章于 2023-08-18 16:48:08 发布