|
|
|
มัน ERROR Cannot update 'EM_ID'; field not updateable. เกิดจากอะไรครับ |
|
|
|
|
|
|
|
Code (VB.NET)
Dim id As Integer = TextBox25.Text
strSQL = "UPDATE EM " & _
"SET EM_ID=" & TextBox25.Text & _
" , Title='" & ComboBox7.Text & "'" & _
", FirstName='" & TextBox27.Text & "'" & _
",LastName='" & TextBox20.Text & "'" & _
" ,[Position]='" & ComboBox6.Text & "'" & _
", Salary='" & TextBox24.Text & "'" & _
", RegisterAddress='" & TextBox23.Text & "'" & _
", Card_ID='" & TextBox22.Text & "'" & _
", IssuedBy='" & TextBox21.Text & "'" & _
", DateCard='" & DateTimePicker6.Text & "'" & _
", ExpiresCard='" & DateTimePicker5.Text & "'" & _
", Tel='" & TextBox26.Text & "'" & _
", Email='" & TextBox28.Text & "'" & _
" WHERE EM_ID = " & id
Tag : VB.NET
|
|
|
|
|
|
Date :
2013-06-09 00:38:57 |
By :
Project |
View :
798 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันเป็นพวก Auto Number หรืเปล่าครับ
|
|
|
|
|
Date :
2013-06-09 06:57:52 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับผมเปลี่ยนมาเขียนแบบนี้ครับ
อาจเป็นประโยชน์กับคนอีกหลายคนครับขอแชร์ code ที่ผ่านแล้วนะครับ
code
strSQL = "UPDATE EM SET " & _
" Title='" & ComboBox7.Text & "'" & _
",FirstName='" & TextBox27.Text & "'" & _
",LastName='" & TextBox20.Text & "'" & _
",[Position]='" & ComboBox6.Text & "'" & _
",Salary='" & TextBox24.Text & "'" & _
",RegisterAddress='" & TextBox23.Text & "'" & _
",Card_ID='" & TextBox22.Text & "'" & _
",IssuedBy='" & TextBox21.Text & "'" & _
",DateCard='" & DateTimePicker6.Text & "'" & _
",ExpiresCard='" & DateTimePicker5.Text & "'" & _
",Tel='" & TextBox26.Text & "'" & _
",Email='" & TextBox28.Text & "'" & _
" WHERE EM_ID = " & id
|
|
|
|
|
Date :
2013-06-09 16:18:33 |
By :
project |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|