M
mattklassen
Based on what I've read about performance improvements in SQL Mobile, I
have started down the road to migrate an application from VS 2003/SQL
CE 2 to VS 2005/SQL Mobile. So far, however, I am sorely disappointed
with the performance of the new platform. In fact, filling a datatable
with one of my queries has proved to take over 10 times as long on the
new platform.
This is such a big difference that I'm sure I must be doing something
wrong. I'll post my code and I would appreciate if anyone has any
ideas for me.
Dim sSQL$
Dim oCmd As New SqlCeCommand
Dim oDA As New SqlCeDataAdapter
Dim oDT As New Data.DataTable
sSQL = "SELECT Questions.ID AS QID..."
Try
Dim Conn As Data.SqlServerCe.SqlCeConnection = New
Data.SqlServerCe.SqlCeConnection("Data Source=\CF Card\DB\DB1.sdf")
oCmd.Connection = Conn
oCmd.CommandText = sSQL
oDA.SelectCommand = oCmd
oDA.Fill(oDT)
'(I've also tried the new SqlCeResultSet without much better
success: Dim rs As SqlCeResultSet =
oCmd.ExecuteResultSet(ResultSetOptions.None) )
Catch ex As Exception
Throw New Exception("Error" & vbCrLf & vbCrLf & ex.Message)
End Try
Thanks
have started down the road to migrate an application from VS 2003/SQL
CE 2 to VS 2005/SQL Mobile. So far, however, I am sorely disappointed
with the performance of the new platform. In fact, filling a datatable
with one of my queries has proved to take over 10 times as long on the
new platform.
This is such a big difference that I'm sure I must be doing something
wrong. I'll post my code and I would appreciate if anyone has any
ideas for me.
Dim sSQL$
Dim oCmd As New SqlCeCommand
Dim oDA As New SqlCeDataAdapter
Dim oDT As New Data.DataTable
sSQL = "SELECT Questions.ID AS QID..."
Try
Dim Conn As Data.SqlServerCe.SqlCeConnection = New
Data.SqlServerCe.SqlCeConnection("Data Source=\CF Card\DB\DB1.sdf")
oCmd.Connection = Conn
oCmd.CommandText = sSQL
oDA.SelectCommand = oCmd
oDA.Fill(oDT)
'(I've also tried the new SqlCeResultSet without much better
success: Dim rs As SqlCeResultSet =
oCmd.ExecuteResultSet(ResultSetOptions.None) )
Catch ex As Exception
Throw New Exception("Error" & vbCrLf & vbCrLf & ex.Message)
End Try
Thanks