Sqlserverce Resultset

Discussion in 'microsoft.public.sqlserver.ce' started by Chuck Hecht, Nov 13, 2009.

  1. Chuck Hecht

    Chuck Hecht Guest

    I am confusded over the following sample code it works sometimes and pulls
    data then other times It tells me there are no records in the table.

    cn = New SqlCeConnection("Data Source = \Storage Card\ATMobile.sdf")
    cn.Open()

    Dim cmd As SqlCeCommand = cn.CreateCommand
    cmd.CommandText = "select * from systrakr"

    Dim rs As SqlCeResultSet = cmd.ExecuteResultSet(ResultSetOptions.Scrollable
    Or ResultSetOptions.Updatable)
    Me.BindingSource1.DataSource = rs
    Me.DataGrid1.DataSource = rs

    Me.ComboBox1.DataSource = rs
    Me.ComboBox1.DisplayMember = "username"

    'cmd.CommandText = "select asset_no, descript, qty, category
    from assets where asset_no =" & "'" & 100360 & "'"

    Dim rdr As Data.SqlServerCe.SqlCeDataReader = Nothing

    Dim values(rs.FieldCount - 1) As Object
    rs.GetValues(values)


    rdr = cmd.ExecuteReader()
     
    Chuck Hecht, Nov 13, 2009
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.