all groups > sql server odbc > january 2006 >
You're in the

sql server odbc

group:

Insert command not affecting the table but is recognized by profil



Insert command not affecting the table but is recognized by profil Neo
1/20/2006 9:00:02 AM
sql server odbc: I've been trying to add a simple record to SQL Server 2000 and it is not
recognizing the insert statement. The SQL profiler is picking up the command
from the application, but it is not updating the table with the new record.
If there are any suggestions, it would be appreciated.
Here is my code

Dim dsBSP As New DataSet("BSP_Test")
Dim dt As New DataTable
Dim connStr As String =
"Server=tiger;Database=BSP_TEST;Uid=sa;Pwd=HCL1767;"
Dim objConn As New SqlConnection(connStr)

objConn.Open()
daBSP.FillSchema(dsBSP, SchemaType.Source, "BSP")
daBSP.Fill(dsBSP, "BSP")
lstDisplay.DataSource = dsBSP

Dim tblBSP As DataTable
tblBSP = dsBSP.Tables("BSP")


Dim objCommandBuilder As New SqlCommandBuilder(daBSP)
daBSP.InsertCommand = New SqlCommand("Insert Into BSP(DT_CRTD)
values (Now())", objConn)

As mentioned, the insertcommand is being noticed by the profiler but not
affecting the table.
I also tried to use the .Update statement (assuming it would commit any
changes)
but this just gives me an unhandled exception/System Error
RE: Insert command not affecting the table but is recognized by profil RDBSAdmin
1/21/2006 10:00:03 AM
1. Do you receive any error when you try to insert a record?
2. Can you issue SELECT @@VERSION statement via Query Analyzer and post here
the result of the execution?

[quoted text, click to view]
AddThis Social Bookmark Button