如何更新数据库呢?我是通过sda.Update(ndt);来更新的
private void Form1_Load(object sender, EventArgs e)
{
//打开表
string strSql="Server=.;Database=weight;Uid=sa;Pwd=000";
nSqlcon = new SqlConnection(strSql);
nSqlcon.Open();
strSql = "select * from material order by id";
sda = new SqlDataAdapter(strSql, nSqlcon);
SqlCommand scmd = new SqlCommand("select * from material order by id", nSqlcon);
sda.SelectCommand = scmd;
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
nds = new DataSet();
sda.Fill(nds);
ndt = nds.Tables[0];
dataGridView1.DataSource = ndt;