G
Guest
Hi,
I am somewhat confused as to how I can levarage Data Binding and data adapters with web forms.
I think I figured out the update part, but when I want to start with a brand new record, my data binding fails with "Index 0, or not non-negative" error.
I created a data adapter that autogenerated statements for SELECT, UPDATE and INSERT.
I also have a web form with a number of data bound elements such as:
<asp:textbox id=txtFirstName runat="server" Text='<%# DataBinder.Eval(DsClient1, "Tables[Client].DefaultView.[0].FirstName") %>'></asp:textbox><asp:textbox id=txtLastName runat="server" Text='<%# DataBinder.Eval(DsClient1, "Tables[Client].DefaultView.[0].LastName") %>'></asp:textbox>
If I want to start with a new record, what code shall I put in the Page_Load in order for these data-bindings to work?
Thanks.
Zhenya
http://www.rusmex.com
I am somewhat confused as to how I can levarage Data Binding and data adapters with web forms.
I think I figured out the update part, but when I want to start with a brand new record, my data binding fails with "Index 0, or not non-negative" error.
I created a data adapter that autogenerated statements for SELECT, UPDATE and INSERT.
I also have a web form with a number of data bound elements such as:
<asp:textbox id=txtFirstName runat="server" Text='<%# DataBinder.Eval(DsClient1, "Tables[Client].DefaultView.[0].FirstName") %>'></asp:textbox><asp:textbox id=txtLastName runat="server" Text='<%# DataBinder.Eval(DsClient1, "Tables[Client].DefaultView.[0].LastName") %>'></asp:textbox>
If I want to start with a new record, what code shall I put in the Page_Load in order for these data-bindings to work?
Thanks.
Zhenya
http://www.rusmex.com