Table DataAdapters Not updating the Database  
Author Message
Alagu Thirunavirkarasu





PostPosted: Visual C# Express Edition, Table DataAdapters Not updating the Database Top

Hi,

I am fed up trying solution for this. Anyone's help is much appreciated.

I have a dataset and a datagridview. I added new rows in the datagrid .
I have a save button which has the click event as below.

UsersDataSet is the Dataset & Users is the table.

int rowsaf = usersTableAdapter.Update(UsersDataSet);
usersTableAdapter.Update(UsersDataSet.Users);
MessageBox.Show(rowsaf.ToString() + "Rows Affected");

The code works perfectly fine and the dataset is updated.
But when I close the application and open again, The datas that I save in the previous run is not available. Means to say, It is not written in the Database.

What I am missing, Please help.




Visual Studio Express Editions7  
 
 
Andrej Tozon





PostPosted: Visual C# Express Edition, Table DataAdapters Not updating the Database Top

Hi,

if you're using SQL Express, your database file probably gets overwritten each time you start your application. Look in this thread for possible solution...

Andrej



 
 
Alagu Thirunavirkarasu





PostPosted: Visual C# Express Edition, Table DataAdapters Not updating the Database Top

Andrej,

Thanks Very Much. It did worked.

I changed teh database property to "Copy, If Newer",

One Doubt, Will this change affect the deployment of the application.