C
Carlo Razzeto
I am trying to initialize an ADO.Net SQL connection to an sql server in my
Windows service and I'm getting the following exception while trying to
initialize the SqlConnection Object. The language is C#.
System.ArgumentException: Unknown connection option in connection string:
user.
at System.Data.SqlClient.ConStringUtil.ParseStringIntoHashtable(String
conString, Hashtable values)
at System.Data.SqlClient.ConStringUtil.ParseConnectionString(String
connectionString)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at NotifyExpiredResume.NotifyExpiredResume.OnStart(String[] args) in
c:\documents and settings\carlo razzeto\my documents\visual studio
projects\notifyexpiredresume\expiredresume.cs:line 111
Here is what my connection string looks like and initializer looks like:
private string ConnectionString = "Data Source=(local); User=sa;
Password=****; Initial Catalog=JobSite";
public SqlConnection SQLConnection;
try
{
SQLConnection = new SqlConnection(ConnectionString);
}
catch(Exception ex)
{
EvntLog.WriteEntry("There has been an exception trying to init
SQLConnection:\n" + ex.ToString(), EventLogEntryType.Error);
EvntLog.Dispose();
return;
}
Windows service and I'm getting the following exception while trying to
initialize the SqlConnection Object. The language is C#.
System.ArgumentException: Unknown connection option in connection string:
user.
at System.Data.SqlClient.ConStringUtil.ParseStringIntoHashtable(String
conString, Hashtable values)
at System.Data.SqlClient.ConStringUtil.ParseConnectionString(String
connectionString)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at NotifyExpiredResume.NotifyExpiredResume.OnStart(String[] args) in
c:\documents and settings\carlo razzeto\my documents\visual studio
projects\notifyexpiredresume\expiredresume.cs:line 111
Here is what my connection string looks like and initializer looks like:
private string ConnectionString = "Data Source=(local); User=sa;
Password=****; Initial Catalog=JobSite";
public SqlConnection SQLConnection;
try
{
SQLConnection = new SqlConnection(ConnectionString);
}
catch(Exception ex)
{
EvntLog.WriteEntry("There has been an exception trying to init
SQLConnection:\n" + ex.ToString(), EventLogEntryType.Error);
EvntLog.Dispose();
return;
}