J
JS
Having a little trouble getting at my data after the webform I'm using is
submitted. Perhaps this is better posted to web forms, but its my ADO
implementation that seems to be the problem. 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
submitted. Perhaps this is better posted to web forms, but its my ADO
implementation that seems to be the problem. 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
</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