DataBound WebForms DataSet goes Empty

J

JS

Having a little trouble getting at my data after the webform I'm using is
submitted. Posted to ADONet, but perhaps web controls is a better place.
I'm using a DataSet control on a form that I bind the form's controls to.
But when I check that DataSet at the server after a button click on the
form, its completely empty, no DataTables in it at all.

Any insights would greatly be appreciated.


<form runat=server>
<asp:TextBox id="txtTitle" runat="server" Text='<%#
DataBinder.Eval(DsArticles1, "Tables
.DefaultView.[0].Title") %>'>
</asp:TextBox>
</form>


Protected WithEvents DsArticles1 As News.DSArticles 'DS object on web
form

Sub Page_Load()
Dim oArticles As Articles.Articles
oArticles = New Articles.Articles() 'Custom Data Retrieval
Object - returns a DS

Dim oDS As DataSet
oDS = oArticles.GetArticles("WHERE ID = '" & strID & "'")

DsArticles1.Merge(oDS)

DataBind()

Response.Write(DsArticles1.Tables("Table").Rows.Count)

'**** RETURNS 1 ****
' Works great, Form shows the data from this row per data bound
control as above txtTitle

End Sub

Sub butSave_Click
System.Diagnostics.Trace.Write(DsArticles1.Tables("Table").Rows.Count)
' **** NOW RETURNS 0 ****
' In fact, now there are no datatables in this dataset at all.

System.Diagnostics.Trace.Write(DsArticles1.GetXml)
' **** RETURNS: '<DSArticles
xmlns=" http://tempuri.org/Schema_Articles.xsd " />' ****

System.Diagnostics.Trace.Write(txtTitle.text)
' **** RETURNS PROPER FIELD VALUE ****

End Sub
 

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

No members online now.

Forum statistics

Threads
473,811
Messages
2,569,693
Members
45,477
Latest member
IsidroSeli

Latest Threads

Top