Hi, I use ASP.NET and my problem is I´ve two buttons, a dataSet, a
dataGrid and a sqlDataAdpater, I use
sqlDataAdapter.fill(dataSet,"dbTable"), then when when the user press
the first button, I add a row to a dataSet, but not to the dataBase.
This is my code:
Public Sub Button1_Click(byBal sender As System.Object, byVal e As
System.EventArgs) Handles Button1.Click
dim myRow as dataRow
myRow = dataSet.Tables("dbTable").newRow
myRow("id")=1
myRow("description")="Trade Company"
dataSet.Tables ("dbTable").Rows.Add(myRow)
dataGrid.dataBind()
End Sub
Public Sub Button2_Click(byBal sender As System.Object, byVal e As
System.EventArgs) Handles Button2.Click
dim xDataSet As dataSet
dim myRow as dataRow
If dataSet.HasChanges Then
xDataSet = dataSet.getChanges(DataRowState.Added)
xDataSet.Tables("dbTable").newRow()
for each myRow in xDataSet.tables("dbTable").Rows
'Here I call a Store Procedure with sqlDataReader and saved the
register in dataBase's Table
next
End If
End Sub
Then, when the user press button1; after add the row the
dataSetdataSet.HasChanges = TRUE , then the user press the Button2 and
the datataSet.HasChanges =FALSE,so the dataSet lost its state, I think
it happens when the WebForm return to the user...
In fact, I need put the button2's code in another webForm....
Thanks!!!!
Evelin
Sorry, but I don´t speak english very well as you saw....