tableadapter.update的问题 [英] problem with tableadapter.update

查看:140
本文介绍了tableadapter.update的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i使用:Visual C#2008,SQL Express 2005



这是代码:





i am using: Visual C# 2008, SQL Express 2005

this is the code :

DataTable dt;
ProjectDS dsPro;
ProjectDSTableAdapters.tblCfgTableAdapter taCfg;
object[] ao

dt = dsPro.Tables["tblCfg"];

dt.BeginLoadData();
dt.LoadDataRow(ao,false); (ao : object[])
dt.EndLoadData();
taCfg.Update(dsPro.tblCfg);





没有运行时错误



dt有autoincrement-column,所以ao包含该列的'null'



在LoadDataRow之后:debug显示dt包含新的数据自动增量值但是在taCfg.Update之后是-1



:在database-explorer中,db-table不包含那些数据



代码中缺少什么东西?



提前感谢



there's no runtime error

dt has autoincrement-column, so ao contains 'null' for that column

after LoadDataRow : debug shows dt containes the new data autoincrement value however is -1

after taCfg.Update : in database-explorer the db-table DOES NOT contain that data

something missing in the code ?

thanks in advance

推荐答案

这篇关于tableadapter.update的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆