asp:ObjectDataSource

  • Thread starter Thread starter Bruno Alexandre
  • Start date Start date
B

Bruno Alexandre

Hi Guys,

I have a problem that I can't figure it out how can I resolve it...

I have a DataTable serving as ObjectDataSource and I can't get the Update,
Delete and Insert work

code inside asp:ObjectDataSource
<UpdateParameters>
<asp:ControlParameter Name="newQtd" Type="Int32" ControlID="tbxQty"
PropertyName="Text" />
<asp:ControlParameter Name="cod" Type="String" ControlID="lblCode"
PropertyName="Text" />
</UpdateParameters>

"newQtd" and "cod" are ROWS in the DataTable
"tbxQty" and "lblCode" are Textbox and Label inside a templatefield inside
EditItemTemplate in GridView

The error that I'm getting is that the Sytem can't find the countrolID's ...
but they exist!

I already cross Google and some ASP.NET 2.0 books that I have but no one
have referencies for DataTable feeding ObjectDataSource and so I can't
really know what's going on...

....any ideas?
--



Thank you in Advance.

Bruno Alexandre
(a Portuguese in Denmark)
 
The controls exist only inside your GridView, whereas the
ObjectDataSource searches the page for them.
In order for this to work, you could Bind (not Eval) your textbox to
newQtd and use a simple <asp:Parameter Name="newQtd" Type="Int32" />.
This should do the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top