asp:ObjectDataSource

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)
 
V

Vlad Iliescu

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top