使用循环保存记录? [英] saving records using loop?

查看:57
本文介绍了使用循环保存记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi如何在保存时如何给出代码以将该代码放入循环中.
这是我在btnSave中的代码click

hi how to give code to place this code in loop while saving.
here is my code in btnSave click

BidTreePL objBIDPL = new BidTreePL();
        TenderPreparationPL objTPRPL1 = new TenderPreparationPL();
        //SqlTransaction trans;
        SqlConnection cnn = new SqlConnection();
        objTPRPL1.btDID = SessionManager.TPR1DID;
        objTPRPL1.btDocType = SessionManager.CurrentDocType;
       // objTPRPL.btDocType = objTPRPL1.btDocType;
        objTPRPL1.btName = objTPRPL1.btName;
        objTPRPL1.btNodeID = objTPRPL1.btNodeID;
        objTPRPL1.btParentNodeID = objTPRPL1.btParentNodeID;
        objTPRPL1.btType = objTPRPL1.btType;
        objTPRPL1.btDetails = objTPRPL1.btDetails;
        TenderPreparationDAL objTPRBL = new TenderPreparationDAL();
        objTPRBL.InsertBidTree(objTPRPL1);



这在使用树节点的@Name期望参数..am中出错,同时添加了三个以上的节点,我可以更改该树节点的名称,并在保存时应使用树节点名称保存不同的记录.
并以静态方式使用代码,以动态方式设计,因此节省了零件..

例如



here am getting error for @Name expects parameter..am using tree nodes and while adding more than three nodes i can change the name of that tree nodes and while saving it should save different records with tree node name.
and am using code as static and design as dynamic so am stuck with saving part..

for example

   objTPRPL1.btNodeID = objTPRPL1.btNodeID;
objTPRPL1.btNodeID=//how to set here like txtNodeID.Text(this we use for static) and how to use here for dynamic


以及如何使用循环将新行(来自树节点的三个以上记录可能是文本框)插入到现有数据表中?
.so有人可以建议我
??
谢谢u


and how to insert new rows (more than three records from tree node may be text box)into existing datatable using loop?
.so can any one suggest me
??
thanks u

推荐答案

该错误消息与缺少的语句参数有关.由于您的DAL在其他地方,而不是在这段代码中,所以我无法猜测出确切的问题.但是,如果您不想与我们共享InsertBidTree方法,请尝试对其进行调试.
The error message is related to a missing statement parameter. As your DAL is somewhere else, not in this piece of code, I can not guess the exact problem. But try to debug the InsertBidTree method, if you don''t want to share it with us.


这篇关于使用循环保存记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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