[2005] Whats Wrong with this code??
when i excute these line of code if gives me an error message (Unclosed quotation mark after the character string ''.)????????????
Code:
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
Dim SQL As String = "insert into Procedures(ProcedureName) Values('" & txtProcedureName.Text & "' )'"
Dim cmdq As New SqlClient.SqlCommand
cmdq.Connection = conn
cmdq.CommandType = CommandType.Text
cmdq.CommandText = SQL
conn.Open()
cmdq.ExecuteNonQuery()
conn.Close()
MsgBox("تمت العملية بنجاح")
End Sub
Re: [2005] Whats Wrong with this code??
Change this:
vb.net Code:
Dim SQL As String = "insert into Procedures(ProcedureName) Values('" & txtProcedureName.Text & "' )'"
to this:
vb.net Code:
Dim SQL As String = "insert into Procedures(ProcedureName) Values('" & txtProcedureName.Text & "' )'"
MessageBox.Show(SQL)
and you should be able to see for yourself.