TableAdapter.Update():一个下来,要去多少? [英] TableAdapter.Update() : One down, how many to go ?

查看:99
本文介绍了TableAdapter.Update():一个下来,要去多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨再次,



这是我的代码:

hi again,

here is my code :

int n = dsCfg.tblCfg.Columns.Count;

Object[] ao = new object[n];

ao[0] = "SETTINGS";
ao[1] = 0;
ao[2] = some value

dsCfg.tblCfg.LoadDataRow(ao,false);
taCfg.Update(dsCfg.tblCfg); // -> throws exception : cannot insert duplicate PRIMARY KEY



tblCfg有6列:0 = nchar(10),1 = int,其他所有类型都是sqlvariant; 0和1构建PRIMARY KEY



所以如果它不能插入为什么它不起来?

任何帮助(除了试试这个...(意思是我不想重写项目))赞赏



提前感谢


tblCfg has 6 columns : 0=nchar(10), 1=int, all others are type sqlvariant; 0 and 1 build PRIMARY KEY

so if it can''t insert why doesn''t it up ?
any help (except try this... (means i don''t want to rewrite the project)) appreciated

thanks in advance

推荐答案





得到它:TableAdapter'的Fill-Methode丢失了!



现在工作正常!


got it : TableAdapter''s Fill-Methode was missing !

now works fine !


这篇关于TableAdapter.Update():一个下来,要去多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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