Hi, I am trying to access a MS Access database using Windows form. I added my connection string in App.congig file.
="1.0"="utf-8"
<configuration>
<connectionStrings>
<clear/>
<add name="Constr" providerName="System.Data.OleDb"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\XXXX\\Documents\\YYYYY.accdb; Persist Security Info=False;"/>
</connectionStrings>
</configuration>
Code I added in my code to read this is
string connectionstring = ConfigurationManager.ConnectionStrings["Constr"].ConnectionString;
but I am getting following error on this line.
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=LoadTrackingTool.
I am not getting why I am getting this error. Can anyone please help me out in this. I am new in this functionality.
Thnx,
Aduu