How did I connect:
public DataSet GetUID(string uid)
{ DataSet ds = new DataSet();
sqlComm = new SqlCommand();
sqlComm.Connection = connectionString;
sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.CommandText = "Client_GetUID"; sqlComm.Parameters.Add("@uid", SqlDbType.Text, 16).Value = uid;
try
{
Helper.FillDataSet(sqlComm, ds, "Users"); sqlComm.CommandText, ds, tableNames, SearchValue);
if (!EventLog.SourceExists(sSource))
{
EventLog.CreateEventSource(sSource, sLog);
}
sEvent = "App_Code/DataTier.GetUID Normal Operation"; EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Information, 301);
}
catch (SqlException ae)
{
if (!EventLog.SourceExists(sSource))
{
EventLog.CreateEventSource(sSource, sLog);
}
sEvent = "App_Code/DataTier.GetUID:" + ae.ToString(); EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Warning, 101);
}
return ds;
}
connection string:
Data Source=TedsLaptop;Initial Catalog=VoterTest;Integrated Security=True;Uid=teddarr;Password=xxxxxxxx" providerName="System.Data.SqlClient"
Also tried this using windows authentication
Data Source=TedsLaptop;Initial Catalog=VoterTest;Integrated Security=True;" providerName="System.Data.SqlClient"
I've just finished putting some event logging code into the program, but the data I got back so far is useless because I haven't put it in early enough in the workflow.
Everything is telling me I am not getting a connection with the database, I just don't know why, nor have I proven 100% that this is what is happening.
Any help is appreciated.
Ted