Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a window application in c# 4.0, i used inbuilt sql database (.mdf datbase) in VS2010. earlier it was working fine. But now i noticed a problem in it.
working:
1)user get added to the database, that is confirmed by ExecuteNoQuery return 1, as new one row is inserted.
2)Then next user is also added, as previous user id was 1, it check last id and increment id by 1. it also get successfully added.

3)Search operation also work properly.


But when i close the application, nothing get saved in database. I refresh database
after that also nothing happened.
1
So when i restart application, user id again start from 1.

When earlier add new database to project, only database with mdf and log file was created. But this time it also create DrishyaDatabaseDataSet.xsc files.(Once i deleted them , were they important)
Posted

1 solution

The xsc file does not contain information unless you are using the new data sources window to define default control binding for the data fields in your data set. That information will be used when you drag the data table to a WinForm to generate a default UI. If you are using this function, and change the binding controls in the data source window, the file will contain those settings. You would lose those settings, if you delete this file. However, if you don't use this, you don't need this file.

Your issue seems like
1. You may used uncommited transaction:
Commit any transactions before you close out.

or
2. Your DB is created every time:
Initial Catalog=Database1;Data Source=<server name="">;Integrated Security=True;User Instance=False
 
Share this answer
 
Comments
footballpardeep 29-Sep-12 16:50pm    
User Instance , should be true or false
Kuthuparakkal 29-Sep-12 16:55pm    
false
footballpardeep 29-Sep-12 17:02pm    
I tried but true/false but it's not working.
footballpardeep 29-Sep-12 17:05pm    
How to comit any transaction.
footballpardeep 29-Sep-12 17:09pm    
http://www.4shared.com/archive/tpmIdiUI/Drishya.html

My project is here , can u check whether it is working fine there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900