Hello,
I'm new to ADO.net, so I wrote some little methods for expermentations.
I want to store data with a typed adapter in a filebase database (*.mdf-file). I used the wizards of VS 2010 Express to generate the adapters.
If I run the methode in debug it looks good. The data is persisted. But if I restart the application in debug-mode, the whole data is fanished. So I think, the data isn't persisted right.
If I deploy the code to a real application it looks all right.The data is persisted even if I restart the application.
I've added the code I use. Can you tell me, where I'm wrong?
Thanks in reguards
Kostarsus
I'm new to ADO.net, so I wrote some little methods for expermentations.
I want to store data with a typed adapter in a filebase database (*.mdf-file). I used the wizards of VS 2010 Express to generate the adapters.
If I run the methode in debug it looks good. The data is persisted. But if I restart the application in debug-mode, the whole data is fanished. So I think, the data isn't persisted right.
If I deploy the code to a real application it looks all right.The data is persisted even if I restart the application.
I've added the code I use. Can you tell me, where I'm wrong?
Code:
public void insertStaticData()
{
testAdapter = new TestTableAdapter();
ds1 = new DataSet1();
testAdapter.Fill(ds1.Test);
try
{
testAdapter.Insert(1, "TestText");
ds1.AcceptChanges();
}
catch (SqlException e)
{
MessageBox.Show(e.Message);
ds1.RejectChanges();
}
}
Thanks in reguards
Kostarsus