Protected Sub Btn_update_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Btn_update.Click
Dim objConn As SqlConnection
Dim strConnString As String
Dim strSQL As StringBuilder
Dim objCmd As SqlCommand
Dim dtAdapter As SqlDataAdapter
Dim dt As DataTable
Dim ds As New DataSet
'*** Open Connection ***'
strConnString = "Server=ULTRAMOSHI-PC;UID=sa;PASSWORD=1234;Database=RM2013;Max Pool Size=400;Connect Timeout=600;"
objConn = New SqlConnection
objConn.ConnectionString = strConnString
objConn.Open()
'*** Update Profile ***'
strSQL = New StringBuilder
strSQL.Append(" UPDATE personnel SET ")
strSQL.Append(" txb_nameper = @stxb_nameper ")
strSQL.Append(" ,txb_tell = @stxb_tell ")
strSQL.Append(" ,ddb_position = @sddb_position ")
strSQL.Append(" ,ddb_cat = @sddb_cat ")
strSQL.Append(" ,ddb_qua = @sddb_qua ")
strSQL.Append(" ,ddb_workgroup = @sddb_workgroup ")
strSQL.Append(" WHERE Username = @sUsername ")
objCmd = New SqlCommand(strSQL.ToString(), objConn)
objCmd.Parameters.Add("@stxb_nameper", SqlDbType.VarChar).Value = Me.txb_nameper.Text
objCmd.Parameters.Add("@stxb_lastnameper", SqlDbType.VarChar).Value = Me.txb_lastnameper.Text
objCmd.Parameters.Add("@stxb_tell", SqlDbType.VarChar).Value = Me.txb_tell.Text
objCmd.Parameters.Add("@sddb_position", SqlDbType.VarChar).Value = Me.ddb_position.Text
objCmd.Parameters.Add("@sddb_cat", SqlDbType.VarChar).Value = Me.ddb_cat.Text
objCmd.Parameters.Add("@sddb_qua", SqlDbType.VarChar).Value = Me.ddb_qua.Text
objCmd.Parameters.Add("@sddb_workgroup", SqlDbType.VarChar).Value = Me.ddb_workgroup.Text
objCmd.Parameters.Add("@sUsername", SqlDbType.VarChar).Value = Session("strUsername")
objCmd.ExecuteNonQuery()
objConn.Close()
objConn = Nothing
Me.UpdateProfile.Visible = False
Me.pnlFinish.Visible = True
End Sub
ก็ไม่ได้ครับ และยังมี Error เพิ่มมาอีกครับ
Invalid column name 'txb_nameper'.
Invalid column name 'txb_tell'.
Invalid column name 'ddb_position'.
Invalid column name 'ddb_cat'.
Invalid column name 'ddb_qua'.
Invalid column name 'ddb_workgroup'.