Windows application sql problem

Feb 16 2012 5:12 AM
Hi ,
 
Lately i was trying to develop a windows application with c# n sql 2005. i got stucked at a point where i can insert data into the sql db but when i close n open my application, the data is gone. i'll explain briefly,
i've created the sql database(i.e, SKTDB.mdf) and table using server explorer in visual studio 08. my connection string is like ,

sDBPath = Application.StartupPath + "\\DB\\SKTDB.mdf";
 if (System.IO.File.Exists(sDBPath))
 {
   connStr = "Data Source=.\\SQLEXPRESS;AttachDbFilename='" + sDBPath + "';User ID=sa;Password=1234";
 }

 
I have a registration form in my app. when i fill the form and submit , the data is inserted into the table in SKTDB.mdf. but when i restarts my application , the table is empty. I cant figure out the reason. if u guys can , pls let me know..

Answers (2)