sqladapter question

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

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
 
Agnes said:
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.
 
Back
Top