Question System.InvalidOperationException error How can I solve it???

tobias12

New member
Joined
May 28, 2009
Messages
1
Programming Experience
1-3
Hey this is my first time in here, so I practically newbie at data manage in VB.Net

I was making a practice with a Data Set and i was doing everything as i was told in the example and then when i press the update DB Button this error appears: System.InvalidOperationException , :confused: please can you guys help me?

I was doing this example:

Walkthrough: Simple Data Access in a Windows Form

Heres the code:

VB.NET:
Imports System.Data.SqlClient.SqlException

Public Class Form1

    Private LoadBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.SqlDataAdapter1.Fill(DsLoc1)

    End Sub

    Private UpdateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.SqlDataAdapter1.Update(DsLoc1)
        MsgBox("Updated DB!!")
    End Sub
End Class
 
We are going to need more information than just the type of exception that was thrown. Please include the full message (and stack trace if you cannot figure it out). Message might be something like: "Value for PersonID cannot be NULL"

In which case, hopefully, you'd be able to work out the problem ;)
 

Latest posts

Back
Top