When trying to update the database from vb .net I gor the following error. Although There is no column called _Page in the database.
Server Error in '/WebSite1' Application.
Invalid column name '__Page'.
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name '__Page'.
Source Error:
Line 105:
Line 106: Dim mydataset As New DataSet()
Line 107: mydataAdapter.Fill(mydataset, "student")
Line 108:
Line 109:
The Code in the click event of the update button is as follows:
Dim cs, commandString4 As String
Dim dt As New DataTable()
cs = "SELECT last_name, first_name, mi, appt_type FROM student WHERE UID =" & ID
commandString4 = "UPDATE student SET last_name=" & TextBox2.Text & ",first_name=" & TextBox3.Text & ",mi=" & TextBox4.Text & ",appt_type=" & DropDownList1.Text & "WHERE UID=" & TextBox1.Text
Dim mydataAdapter As New System.Data.SqlClient.SqlDataAdapter(cs, con)
Dim mydataset As New DataSet()
mydataAdapter.Fill(mydataset, "student")
dt.TableName = "student"
dt.Rows(0)("UID") = TextBox1.Text
dt.Rows(1)("last_name") = TextBox2.Text
dt.Rows(2)("first_name") = TextBox3.Text
dt.Rows(3)("mi") = TextBox4.Text
dt.Rows(4)("appt_type") = DropDownList1.Text
mydataAdapter.Update(dt)
MsgBox(" One record updated")
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
End Sub
Where may be the flaw in this code?
Please help me.
Thanks.
[/font]
Server Error in '/WebSite1' Application.
Invalid column name '__Page'.
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name '__Page'.
Source Error:
Line 105:
Line 106: Dim mydataset As New DataSet()
Line 107: mydataAdapter.Fill(mydataset, "student")
Line 108:
Line 109:
The Code in the click event of the update button is as follows:
Dim cs, commandString4 As String
Dim dt As New DataTable()
cs = "SELECT last_name, first_name, mi, appt_type FROM student WHERE UID =" & ID
commandString4 = "UPDATE student SET last_name=" & TextBox2.Text & ",first_name=" & TextBox3.Text & ",mi=" & TextBox4.Text & ",appt_type=" & DropDownList1.Text & "WHERE UID=" & TextBox1.Text
Dim mydataAdapter As New System.Data.SqlClient.SqlDataAdapter(cs, con)
Dim mydataset As New DataSet()
mydataAdapter.Fill(mydataset, "student")
dt.TableName = "student"
dt.Rows(0)("UID") = TextBox1.Text
dt.Rows(1)("last_name") = TextBox2.Text
dt.Rows(2)("first_name") = TextBox3.Text
dt.Rows(3)("mi") = TextBox4.Text
dt.Rows(4)("appt_type") = DropDownList1.Text
mydataAdapter.Update(dt)
MsgBox(" One record updated")
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
End Sub
Where may be the flaw in this code?
Please help me.
Thanks.
[/font]