make sure you have a primary key for your table, and the key is in the SELECT list, also use a SqlCommandBuilder
解决方案 »
- 请教:C#如何定义一个结构体数组的指针?
- datagridview的问题!
- 关于七彩乐彩票所有组合数的计算。
- 为什么调用File.Copy方法生成的文件只有1K大小啊,源文件是正常的
- 请问大虾,我想要用表格的形式显示出来,帮我看一下代码。实现不了,清指导。(在线等)
- C#的程序里怎么让系统暂停一小段时间?
- FTP上传和下载是要先根据所传文件的类型来选择ascii或者binary 模式,那么请问怎样判断所传文件的类型呢?(除了根据扩展名判断以外)
- 微软VS2010自带的安装程序可以执行某个文件吗?
- TcpClient如何指定某个IP时行链接
- 如何为formborderstyle为none的窗体在任务栏中实现右键功能
- 紧急求救,win2000高级服务器版操作系统安装USB设备错误,怎么办
- 还是哪个问题,up有分,
{
SqlConnection myConn = new SqlConnection(myConnection);
SqlDataAdapter myDataAdapter = new SqlDataAdapter();
myDataAdapter.SelectCommand = new SqlCommand(mySelectQuery, myConn);
SqlCommandBuilder cb = new SqlCommandBuilder(myDataAdapter); myConn.Open(); DataSet ds = new DataSet();
myDataAdapter.Fill(ds, myTableName); //code to modify data in DataSet here //Without the SqlCommandBuilder this line would fail
myDataAdapter.Update(ds, myTableName); myConn.Close(); return ds;
}