您的位置:程序门 -> .net技术 -> c#



关于tableadapter调用insert,update,delete问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


关于tableadapter调用insert,update,delete问题
发表于:2007-09-20 01:35:22 楼主
关于tableadapter调用insert,update,delete问题我在建立tableadapter时在“高级”里选择了“生成插入,更新,和删除语句”   这个选项。然后我的tableadapter的 "属性 "里就出现了insertcommand,updatecommand,   和deletecommand这几个属性   不是说当你在程序中调用insert,update,delete的时候就会直接调用到以上几个command属性么?但是我发现在应用tableadapter调用insert,update,delete时候根本不行,错误提示是说这几个东西并不在tableadapter里面   我不知道为什么有属性却不能调用   能给我解释一下么?

下面是我的代码
using   system;
using   system.data;
using   system.configuration;
using   system.collections;
using   system.web;
using   system.web.security;
using   system.web.ui;
using   system.web.ui.webcontrols;
using   system.web.ui.webcontrols.webparts;
using   system.web.ui.htmlcontrols;
using   northwindtableadapters;

public   partial   class   default2   :   system.web.ui.page
{
        protected   void   page_load(object   sender,   eventargs   e)

        {
                northwindtableadapters.productstableadapter   productsadapter   =new   northwindtableadapters.productstableadapter();

                ///////中间代码略/////

           


productsadapter.update(products);//就在这里!说update不是productsadapte的属性                                                              


        }
}


快速检索

最新资讯
热门点击