PDA

Click to See Complete Forum and Search --> : error: SQL mobile made an unsupported request to the host operating system


kryptonboy22
Apr 5th, 2008, 03:18 AM
the error occur after inserting 3 consecutive record. I add the record then after my 3rd time that error pop up. and another i cant view the record i made in my slq server mobile database in my pc. i used emulator. i can only see the record in the emulator database but after i stop the program the record also disappears.

what should be problem? tell me what should i do?


here's my code


Try
ConnDatabase()
cmdSData = CreateSQLConn.CreateCommand
cmdSData.CommandText = "SELECT EANUPC, Itemdesc, RSP, [Count],itemcode FROM t_DATA"
rstSData = cmdSData.ExecuteResultSet(ResultSetOptions.Updatable Or ResultSetOptions.Sensitive)

Dim recSAVE As SqlCeUpdatableRecord = rstSData.CreateRecord()

recSAVE.SetString(0, iBarcode)
recSAVE.SetString(1, iItemDesc)
recSAVE.SetDouble(2, iRSP)
recSAVE.SetDouble(3, iCount)
recSAVE.SetString(4, iItemcode)

rstSData.Insert(recSAVE)


Me.txtBarcode.Text = ""
Me.txtRSP.Text = ""
Me.txtCount.Text = ""

Catch ex As Exception
MessageBox.Show("Error: " & ex.Message)

End Try



Thanks!:wave:

petevick
Apr 5th, 2008, 10:35 AM
Hi,
you may be easier using straight SQL - eg
"insert into eanupc" using parameters

Having never used updatable recordsets, I can't help further on that

Pete

kryptonboy22
Apr 7th, 2008, 02:54 AM
I have used that before but the problem is no record was saved when i used straight SQL query, using tableadapters. Do i have to used table adapters? can you gave me some easy advice or samples? Thanks sir!

petevick
Apr 7th, 2008, 06:22 AM
http://samples.gotdotnet.com/quickstart/CompactFramework/ shows how to open a database and insert records

Pete