I have face the problem of connection string which gives me the error as:
Format of the initialization string does not conform to specification starting at index 0.
Pls give me suggestions on this problem.the code which i had written is:
Web.Config:
and
public static string GetconString()
{
return ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
}
Khargesh RajputPosted Jan 1, 2015, 4:49 AM
as
Riddhi ValechaPosted Jan 1, 2015, 3:29 AM
I have a doubt about Connection String.
In the given method -
public static string GetCOnnectionString();
We get a static string.
My Question is - Should this connection string be static or constant ??
If static, why static and if const, why constant ??
Which is a better approach.
Khan Abrar AhmedPosted May 18, 2014, 4:35 AM
try the below connection string in web.config file.