A
Aaron
Dim sqlcmd1 As New SqlClient.SqlCommand()
Dim sqlcon1 As New SqlClient.SqlConnection()
Dim ds1 As New DataSet()
Dim da1 As New SqlClient.SqlDataAdapter()
Dim dt1 As New DataTable()
sqlcon1.ConnectionString = "Server=CHANGED;User
ID=CHANGED;password=CHANGED;Database=Pursuit"
sqlcon1.Open()
sqlcmd1.CommandText = "Update person set Name_Full = " &
TextBox4.Text & ", Name_First =" & TextBox2.Text & ", Name_Last = " &
TextBox3.Text & ", Company1 = " & TextBox5.Text & ", RecordType = " &
TextBox6.Text & ", ClientType = " & TextBox7.Text & ", Phone = " &
TextBox8.Text & ", BPhone= " & TextBox9.Text & ", BPhone_Extension = " &
TextBox10.Text & ", CellPhone = " & TextBox11.Text & " where person_id = "
& Session("PID") & ""
sqlcmd1.Connection = sqlcon1
da1.UpdateCommand = sqlcmd1
da1.Update(ds1, "Person")
sqlcon1.Close()
When I execute this code I get an error stating:
Update unable to find TableMapping['Person'] or DataTable 'Person'.
I am not sure how to correct this.
Could anyone lend a hand?
The
Dim sqlcon1 As New SqlClient.SqlConnection()
Dim ds1 As New DataSet()
Dim da1 As New SqlClient.SqlDataAdapter()
Dim dt1 As New DataTable()
sqlcon1.ConnectionString = "Server=CHANGED;User
ID=CHANGED;password=CHANGED;Database=Pursuit"
sqlcon1.Open()
sqlcmd1.CommandText = "Update person set Name_Full = " &
TextBox4.Text & ", Name_First =" & TextBox2.Text & ", Name_Last = " &
TextBox3.Text & ", Company1 = " & TextBox5.Text & ", RecordType = " &
TextBox6.Text & ", ClientType = " & TextBox7.Text & ", Phone = " &
TextBox8.Text & ", BPhone= " & TextBox9.Text & ", BPhone_Extension = " &
TextBox10.Text & ", CellPhone = " & TextBox11.Text & " where person_id = "
& Session("PID") & ""
sqlcmd1.Connection = sqlcon1
da1.UpdateCommand = sqlcmd1
da1.Update(ds1, "Person")
sqlcon1.Close()
When I execute this code I get an error stating:
Update unable to find TableMapping['Person'] or DataTable 'Person'.
I am not sure how to correct this.
Could anyone lend a hand?
The