I create the sqladapter programmically.
Dim daInvoice As new sqladapter ("select * from invoice",conMaster)
daInvoice.fill(dsInvoice)
bmInvoice = Me.Bindingcontext(....etc)
Me.txtInvoiceNo.DataBindings.Add("text", dsInvoice,"invoice.invno")
Now, in my add click event. (bmInvoice.addnew())
in my save event.
daInvoice.update(dsInvoice,"Invoice") <-- I got an error here, it said I
need to declare the updatecommand first.
dsInvoice.update()

my invoice got over 50 fields name , DO I need to create 50 parameters in
the commandtext ???
anyshort to update this tables ??

Thanks
From Agnes

Re: sqladapter question by Jon

Jon
Wed Jun 16 11:14:20 CDT 2004

Agnes <agnes@dynamictech.com.hk> wrote:
> I create the sqladapter programmically.
> Dim daInvoice As new sqladapter ("select * from invoice",conMaster)
> daInvoice.fill(dsInvoice)
> bmInvoice = Me.Bindingcontext(....etc)
> Me.txtInvoiceNo.DataBindings.Add("text", dsInvoice,"invoice.invno")
> Now, in my add click event. (bmInvoice.addnew())
> in my save event.
> daInvoice.update(dsInvoice,"Invoice") <-- I got an error here, it said I
> need to declare the updatecommand first.
> dsInvoice.update()
>
> my invoice got over 50 fields name , DO I need to create 50 parameters in
> the commandtext ???
> anyshort to update this tables ??

Well, in some cases you can use a CommandBuilder, but personally I'd
create the command and parameters directly in code. Yes, it's a bit of
a pain, but you could consider driving the code from a resource (maybe
an XML file), or something like that.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too