B
b_r
Hi,
I'm trying to make a simple operation (insert into DB) in VB 2005 and
SQL Server.
The code is as follows:
Dim sConnectionString As String = _
"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB.mdf....
Dim cnDB As New SqlConnection(sConnectionString)
cnDB.Open()
Dim strSQL As String
strSQL = "INSERT INTO Company (CompanyName) VALUES ('four')"
Dim command As SqlCommand = New SqlCommand(strSQL, cnDB)
command.ExecuteNonQuery()
cnDB.Close()
But the row is not inserted into DB and also there is no any error.
Initialy I wanted to use stored procedure but in order to make it
working I made the simplest operation - without success...
Do you have any idea what is wrong?
Regards
BR
I'm trying to make a simple operation (insert into DB) in VB 2005 and
SQL Server.
The code is as follows:
Dim sConnectionString As String = _
"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB.mdf....
Dim cnDB As New SqlConnection(sConnectionString)
cnDB.Open()
Dim strSQL As String
strSQL = "INSERT INTO Company (CompanyName) VALUES ('four')"
Dim command As SqlCommand = New SqlCommand(strSQL, cnDB)
command.ExecuteNonQuery()
cnDB.Close()
But the row is not inserted into DB and also there is no any error.
Initialy I wanted to use stored procedure but in order to make it
working I made the simplest operation - without success...
Do you have any idea what is wrong?
Regards
BR