Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RowState Is Messed up...Help...
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
RowState Is Messed up...Help...
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01224102
Message ID:
01224102
Vues:
60
I have a DataTable that I create a DataView off of. I then selected a specific Row in the DataView and bind it to a series of controls for each required field.

When I change a field value on the form using the control, it makes the change perfectly fine in the underlying table. Problem is, when I close the form, I check for changes using HasChanges() on the tables in question...which checks the RowState os all the records. Strangely...the record I changed, has a RowState of UNCHANGED. How can I tell if changed were made if the RowState doesn't show it...?

Oh, and no, I am not calling AcceptChanges() anywhere.
        '***************************************
        ' Clear All Binds
        '***************************************
        Me.txtFirstName.DataBindings.Clear()
        Me.txtMiddleName.DataBindings.Clear()
        Me.txtLastName.DataBindings.Clear()
        Me.txtStudentID.DataBindings.Clear()
        Me.txtNYSIS.DataBindings.Clear()
        Me.dtDOB.DataBindings.Clear()
        Me.cboGrade.DataBindings.Clear()
        Me.txtNotes.DataBindings.Clear()

        '***************************************
        ' Bind Fields For Basic Student Data
        '***************************************
        Dim objDataView As New DataView(Me.DataSet.Tables("tblStudents"))
        objDataView.Sort = "ID"
        Dim objDataRowView As DataRowView = objDataView(objDataView.Find(Me.listStudents.SelectedItem("ID")))
        Me.txtFirstName.DataBindings.Add("Text", objDataRowView, "FirstName")
        Me.txtMiddleName.DataBindings.Add("Text", objDataRowView, "MiddleName")
        Me.txtLastName.DataBindings.Add("Text", objDataRowView, "LastName")
        Me.txtStudentID.DataBindings.Add("Text", objDataRowView, "StudentID")
        Me.txtNYSIS.DataBindings.Add("Text", objDataRowView, "NYSIS")
        Me.dtDOB.DataBindings.Add("Text", objDataRowView, "DOB")
        Me.cboGrade.DataBindings.Add("SelectedValue", objDataRowView, "Grade_ID")
        Me.txtNotes.DataBindings.Add("Text", objDataRowView, "Comments")
________________________
Ben Santiago, MCP & A+
Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS)
Eastern Suffolk BOCES - Student Data Services


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rich Cook
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform