Link to home
Start Free TrialLog in
Avatar of Dov_B
Dov_B

asked on

Changes I am making to my database during runtime are not permanent

I am using vb.net 2008 express sqlce
when I first started using sql to add and delete records to my database file during runtime the changes remained permenat and I could see them in the database explorer
Now when I delete records when I rerun the program they reappear and when I add records they dont last after I shutdown the application
I did make certain change so that the database would install with my application on other machines
what do I do so that changes will be permanent
SOLUTION
Avatar of PlatoConsultant
PlatoConsultant
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dov_B
Dov_B

ASKER

I put it on copy if newer and the changes during runtime are still not permanent
Can u please upload any sample project so i can look in to it..
Avatar of Dov_B

ASKER


Sub myCommnd(ByVal mSql As String)
Dim constring = "Data Source=" & Application.StartupPath & "\Database1.sdf;Persist Security Info=False;"
Dim myCon As New SqlCeConnection(constring)
Dim f As New SqlCeCommand(mSql, myCon)
myCon.Open()
' Create and fill dataset
f.ExecuteNonQuery()
myCon.Close()
Avatar of Dov_B

ASKER

this is a view of mydatbases's properties
database.bmp
Avatar of Dov_B

ASKER

oops I left out the sql for the command
dim mSql="insert into table values('a')"
Dim f As New SqlCeCommand(mSql, myCon)
 myCon.Open()

f.ExecuteNonQuery()
myCon.Close()
ur problem solved now?
Avatar of Dov_B

ASKER

no
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial