110,569
社区成员
发帖
与我相关
我的任务
分享
string sql = "select count(*) from Table_1";
SqlCommand cmd = new SqlCommand();
cmd.Connection = Conn;
cmd.CommandText = sql;
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds,"table_1");
checkBox1.DataBindings.Add("Text", ds.Tables[0].Rows[0]["keyA"], "");