0

App.config

add name="con" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\transport_db.accdb  ; Persist Security Info=True"/>

Connection object

con = new OleDbConnection(ConfigurationManager.ConnectionStrings["con"].ToString());

when i inserting data no error generating but when i look my original database there is no entry with any data. but when i check inside bin/debug folder and open that database record will show there.

With Full path connection string

add name="con" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=**c:\c#\MyApp\transport_db.accdb**  ; Persist Security Info=True"/>

if i use that full path connection string then data are inserted into my original database which i connected to my application.

I am finding solution for dynamic connection string cause after creating setup file database path will find automatically change.

Thanks in advance.

MethodMan
  • 18,625
  • 6
  • 34
  • 52
Kishan
  • 465
  • 4
  • 13

0 Answers0