Hello ,
again one problem .... I'm not gatting solution plz help...
I created one windows form there was two textbox and one buttion for insert..
i written my connection like...
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\anilananda\documents\visual studio 2013\Projects\demoProject\Database1.mdf;Integrated Security=True");
it is working but when i put like this
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;");
that time it is not inserting and no error message also ....why ?? plz help
=====================
actually i want to create a setup file so i d'nt want to give connection like 1st one because if i give like this it will work in my system only.
so i want to give second one type so that it should work in others system also .
i want to provide the complet databse (Database1.mdf )
in my project file so that it will work as a local databse no need to install sqlserver in other system. because database is available.
but this how to do this i d'nt know ... plz any one help me.
My intention is only create setup file with databse that i will provide in project folder and after creation exe file it should work in other system aslo without having sqlserver in there system.


Ramesh PalanivelRank #372 · 6.8K reputationPosted Mar 12, 2017, 9:15 AM EDT
Rafnas T PRank #280 · 8.8K reputationPosted Mar 12, 2017, 9:36 PM EDT
Rafnas T PRank #280 · 8.8K reputationPosted Mar 12, 2017, 11:36 PM EDT
Anilananda ChakraborttyRank #3,903 · 381 reputationPosted Mar 12, 2017, 11:17 PM EDT
@Rafnas T P
Amit GuptaRank #190 · 12.8K reputationPosted Mar 12, 2017, 11:21 PM EDT
Anilananda ChakraborttyRank #3,903 · 381 reputationPosted Mar 13, 2017, 12:59 AM EDT
Rafnas T P There is no error but when i open db table there is no data..
Amit Gupta It showing that connection not opening...
Rafnas T PRank #280 · 8.8K reputationPosted Mar 13, 2017, 1:27 AM EDT
Anilananda ChakraborttyRank #3,903 · 381 reputationPosted Mar 13, 2017, 2:07 AM EDT
Rafnas T PRank #280 · 8.8K reputationPosted Mar 13, 2017, 2:17 AM EDT
Anilananda ChakraborttyRank #3,903 · 381 reputationPosted Mar 13, 2017, 3:59 AM EDT
@Rafnas T P
Rafnas T PRank #280 · 8.8K reputationPosted Mar 13, 2017, 4:49 AM EDT