Results 1 to 2 of 2

Thread: Updating sqlce database

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Updating sqlce database

    I am trying to create a simple mobile application that saves to a sqlce database. I have created the database and added the datasource. The program has a buttont hat saves information to a sqlce database located in the project. When I click the button it goes through fine without error but no information is stored in the database. After doing some google searches I found that some people fixed this problem with a "AcceptChangesDuringFill=false" but I have not been able to use that either.

    Any help would be greatly appreciated.
    Thanks,
    Nathan


    Public Class index

    Private Sub sqlCeTestButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sqlCeTestButton.Click

    Dim ds As sqlCeTestDataSet = New sqlCeTestDataSet
    Dim ota As sqlCeTestDataSetTableAdapters.lettersTableAdapter = New sqlCeTestDataSetTableAdapters.lettersTableAdapter
    Dim newLettersRow As sqlCeTestDataSet.lettersRow
    newLettersRow = ds.letters.NewlettersRow

    Dim a As String = "a"
    Dim b As String = "b"
    Dim c As String = "c"
    newLettersRow.A = a
    newLettersRow.B = b
    newLettersRow.C = c

    Try
    ds.letters.Rows.Add(newLettersRow)
    Catch ex As Exception

    End Try
    Try
    ota.Update(ds.letters)
    Catch ex As Exception

    End Try

    End Sub
    End Class

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Re: Updating sqlce database

    When I add a new datasource and choose the mobile database it asks me if I wish to copy it to my project. If I click no and try my project the database is updated! If I do copy it to the project it does not update.

    Not sure where I should go next with this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width