ds = new DataSet();
if (MessageBox.Show("确定要保存修改的数据吗?", "修改提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
SqlCommandBuilder comb = new SqlCommandBuilder(sda); sda.Update(ds, "temptest");// 出错 说找不到temptest 为什么?
//dsUpdate.AcceptChanges(); MessageBox.Show("数据修改成功!");
}
catch (Exception ex)
{
MessageBox.Show(ex + "\r\t\n数据修改失败!");
this.button1_Click(sender, e);
}
出错.
Update 无法找到 TableMapping['MyTable'] 或 DataTable“MyTable”。主键 在SQL 设置了
if (MessageBox.Show("确定要保存修改的数据吗?", "修改提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
SqlCommandBuilder comb = new SqlCommandBuilder(sda); sda.Update(ds, "temptest");// 出错 说找不到temptest 为什么?
//dsUpdate.AcceptChanges(); MessageBox.Show("数据修改成功!");
}
catch (Exception ex)
{
MessageBox.Show(ex + "\r\t\n数据修改失败!");
this.button1_Click(sender, e);
}
出错.
Update 无法找到 TableMapping['MyTable'] 或 DataTable“MyTable”。主键 在SQL 设置了
麻烦麻烦
DataSet ds = new DataSet();
SqlDataAdapter sda;sda = new SqlDataAdapter("", conn);
sda.Fill(ds);
this.dataGridView1.DataSource = ds.Tables[0];
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
sda.Update(ds);
this.dataGridView1.DataSource = ds.Tables[0];