app config file code as follows
<appSettings>
<add key="ConStringprod" value="E:\Timesheet\Timesheet\bin\Debug\Prodcon.txt"/>
</appSettings>
CSharp code as follows
string ConStringprod = ConfigurationManager.AppSettings["ConStringprod"].ToString();
SqlCommand cmd = null;
SqlDataAdapter da = new SqlDataAdapter("Select * from user",ConStringprod);
when i run the code i get error as follows
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
i want to read the connection string from Prodcon text file using c#
The above error shows in below line
SqlDataAdapter da = new SqlDataAdapter("Select * from user",ConStringprod);
how to solve this error