S
Shaun Wilde
I get the following exception when using the CF SP2 on the emulator when
trying to use
GetInsertCommand or GetUpdateCommand
I do NOT get this exception when using the original framework as deployed by
VS.NET 2003
First Error
A native exeption occurred in HMI_2003.exe.
Select Quit and then restart this program, or select Details for more
information.
Press 'Details'
ExceptionCode: 0xc0000005
ExceptionAddress 0x0114414c
Reading 0x00000001
code that produces this
Private cnnConnection As System.Data.SqlServerCe.SqlCeConnection
Private adpRequiredDataAdapter As SqlServerCe.SqlCeDataAdapter
'create connection
cnnConnection = New System.Data.SqlServerCe.SqlCeConnection("Data Source = "
& PathToDB & "; Password=" & _password)
Dim strSQLString As String = "SELECT * FROM tTable Where idNo=752101"
' create adapter
adpRequiredDataAdapter = New
System.Data.SqlServerCe.SqlCeDataAdapter(strSQLString, cnnConnection )
Dim cmdBuilder As SqlServerCe.SqlCeCommandBuilder
' create builder
cmdBuilder = New SqlServerCe.SqlCeCommandBuilder(adpRequiredDataAdapter)
' add quotes
cmdBuilder.QuotePrefix = """"
cmdBuilder.QuoteSuffix = """"
'assign Insert command
adpRequiredDataAdapter.InsertCommand = cmdBuilder.GetInsertCommand() '
exception happens here
or
'assign update command
adpRequiredDataAdapter.UpdateCommand = cmdBuilder.GetUpdateCommand() '
exception happens here
trying to use
GetInsertCommand or GetUpdateCommand
I do NOT get this exception when using the original framework as deployed by
VS.NET 2003
First Error
A native exeption occurred in HMI_2003.exe.
Select Quit and then restart this program, or select Details for more
information.
Press 'Details'
ExceptionCode: 0xc0000005
ExceptionAddress 0x0114414c
Reading 0x00000001
code that produces this
Private cnnConnection As System.Data.SqlServerCe.SqlCeConnection
Private adpRequiredDataAdapter As SqlServerCe.SqlCeDataAdapter
'create connection
cnnConnection = New System.Data.SqlServerCe.SqlCeConnection("Data Source = "
& PathToDB & "; Password=" & _password)
Dim strSQLString As String = "SELECT * FROM tTable Where idNo=752101"
' create adapter
adpRequiredDataAdapter = New
System.Data.SqlServerCe.SqlCeDataAdapter(strSQLString, cnnConnection )
Dim cmdBuilder As SqlServerCe.SqlCeCommandBuilder
' create builder
cmdBuilder = New SqlServerCe.SqlCeCommandBuilder(adpRequiredDataAdapter)
' add quotes
cmdBuilder.QuotePrefix = """"
cmdBuilder.QuoteSuffix = """"
'assign Insert command
adpRequiredDataAdapter.InsertCommand = cmdBuilder.GetInsertCommand() '
exception happens here
or
'assign update command
adpRequiredDataAdapter.UpdateCommand = cmdBuilder.GetUpdateCommand() '
exception happens here