Hi
Can anyone tell me where I have gone wrong with the following code : it runs
without errors, but does not insert the record in the table!
Private Sub Button3_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button3.Click
Dim myConnection As SqlClient.SqlCo nnection
Dim myCommand As SqlClient.SqlCo mmand
Dim insertCMD As String
myConnection = New SqlConnection _
("Data Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Bata_CallInfo .mdf;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into CallLog (AccessCode) values ('18002');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()
End Sub
VB.net 2005 Express, SQL Server 2005 Express, Windows XP Professional
"AccessCode " is a field name of type (VarChar(17))
Thanks
Michael Bond
Can anyone tell me where I have gone wrong with the following code : it runs
without errors, but does not insert the record in the table!
Private Sub Button3_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button3.Click
Dim myConnection As SqlClient.SqlCo nnection
Dim myCommand As SqlClient.SqlCo mmand
Dim insertCMD As String
myConnection = New SqlConnection _
("Data Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Bata_CallInfo .mdf;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into CallLog (AccessCode) values ('18002');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()
End Sub
VB.net 2005 Express, SQL Server 2005 Express, Windows XP Professional
"AccessCode " is a field name of type (VarChar(17))
Thanks
Michael Bond
Comment