[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Working with command builders and Sybase

nucleus

10/24/2002 3:47:00 AM

Anyone used these or had any problems with them?

currently I am doing this:
Dim myConnection As New OdbcConnection(myConnectionStr)
Dim myDataAdapter As New OdbcDataAdapter()
Dim mySelectSQL As String = "select * from
misc..tbl_Alerts"

myDataAdapter.SelectCommand = New OdbcCommand(mySelectSQL,
myConnection)
Dim custCB As OdbcCommandBuilder = New OdbcCommandBuilder
(myDataAdapter)

So at the moment I am creating a dataset, updating it,
then trying to post back the changes in the db using the
update method on the dataadappter.
This all seems pretty standard and should flow on easily,
except this next line fails
Debug.WriteLine(custCB.GetUpdateCommand.ToString)

This is the error:
"Additional information: Dynamic SQL generation for the
UpdateCommand is not supported against a SelectCommand
that does not return any modifiable columns."

Now I am logging in as the admin of the database and so
have complete permissions over creating and updating
anything in the database, and I am not trying to modify
the table, just get the command builder to generate the
sql for me.

Anyone have a similar problem?


I also tried it with a table with just 2 cols the 1st
being an auto incrementing id field and the second taking
an integer, you can't get much more rudimentary than this.

I can get a dataset out and loop through the records no
probem but when it comes to the command builder it just
spits the dummy, any help appreciated.

The select statement is very rudimentary:
Dim mySelectSQL As String = "select FirstCol from
misc..tbl_test"


Help appreciated