Partial Class DetailRS
Inherits DetailResultSet <--- this one is generated by
MSResultGenerator...
Private resultSetOptions As
System.Data.SqlServerCe.ResultSetOptions
Public Sub New(ByVal SqlQuery As String)
Dim cmd As New System.Data.SqlServerCe.SqlCeCommand
resultSetOptions =
System.Data.SqlServerCe.ResultSetOptions.Scrollable
resultSetOptions = (resultSetOptions Or
System.Data.SqlServerCe.ResultSetOptions.Sensitive)
resultSetOptions = (resultSetOptions Or
System.Data.SqlServerCe.ResultSetOptions.Updatable)
cmd.Connection = cn
cmd.CommandText = SqlQuery
cmd.ExecuteResultSet(Me.resultSetOptions)
End Sub
End Class
Jim Wilson did a good webcast on using SQL Compact and LINQ that illustrates
the technique:
http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&Params=~CMTYDataSvcParams%5E~arg+Name%3D%22ID%22+Value%3D%221032358821%22%2F%5E~arg+Name%3D%22ProviderID%22+Value%3D%22A6B43178-497C-4225-BA42-DF595171F04C%22%2F%5E~arg+Name%3D%22lang%22+Value%3D%22en%22%2F%5E~arg+Name%3D%22cr%22+Value%3D%22US%22%2F%5E~sParams%5E~%2FsParams%5E~%2FCMTYDataSvcParams%5E
--
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Software for Waste Management
<do...@goroute.com> wrote in message
news:dcb1b496-ea78-43da...@s13g2000prd.googlegroups.com...
This allows me to scroll up and back, use my existing connection,
update lines, use typed values. Very cool.
Thanks again for your help.
Partial Class ITEMResultSet
Public Sub New(ByVal SqlQuery As String)
resultSetOptions =
System.Data.SqlServerCe.ResultSetOptions.Scrollable
resultSetOptions = (resultSetOptions Or
System.Data.SqlServerCe.ResultSetOptions.Sensitive)
resultSetOptions = (resultSetOptions Or
System.Data.SqlServerCe.ResultSetOptions.Updatable)
Me.Open(SqlQuery)
End Sub
Sub Open(ByVal sqlQuery As String)
cmd = New SqlServerCe.SqlCeCommand
cmd = cn.CreateCommand
cmd.CommandText = sqlQuery
cmd.CommandType = CommandType.Text
cmd.ExecuteResultSet(Me.resultSetOptions, Me)
End Sub
End Class