Error in SQL Update on SQL Mobile .SDF

I have problems updating a .SDF database in a Smart Device Application, using VS 2005 June CTP.

I can do SELECT's querys ok.

I use the following code;

--

Dim cnnAsNew System.Data.SqlServerCe.SqlCeConnection(CONNECTIONSTRING)

cnn.Open()

Dim TransAs System.Data.SqlServerCe.SqlCeTransaction

Trans = cnn.BeginTransaction()

Dim updateAsString ="UPDATE Driver SET Language = tLanguage WHERE Driver = tDriver"

Dim cmdAsNew System.Data.SqlServerCe.SqlCeCommand(update, cnn, Trans)

Try

cmd.ExecuteNonQuery()

Trans.Commit()

Catch exAs SqlCeException

Cursor.Current = Cursors.Default

Dim errSQLAs SqlCeError

ForEach errSQLIn ex.Errors

MessageBox.Show(errSQL.Message, _

"Error updating local database", _

MessageBoxButtons.OK, _

MessageBoxIcon.Exclamation, _

MessageBoxDefaultButton.Button1)

tPassword =False

Next

Finally

cnn.Close()

EndTry
The error I get in return is;

The column name is not valid. [Node name(if any)=,Column name = tdriver]
If I can get a solution or suggested code to update a table with VS 2005 Visual Basic using SQL Mobile 2005.

Thank you,
Carlos

[2824 byte] By [CarlosAlfaro] at [2008-2-18]
# 1
I saw your LadyBug about the same issue . Please do send us a sample solution so that I can figure out what's going wrong.

Thanks,
Sriram Krishnan
PM, VSD

SriramKrishnanMSFT at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 2
tLanguage and tDriver are Parameters. You need to use parameter values and not parameter name. To mix them with command text

"UPDATE Driver SET Language = " + tLanguage.toString() + " WHERE Driver = " + tDriver.ToString() "

(assuming tLanguage and tdriver are non-string).

OR

you should use Parameters.Add to add parameters to command.

PrashantDhingra at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...