I keep getting this error:
Invalid object name "CAccounts".
and the code I have is:
System.Threading.Thread thread = new System.Threading.Thread(() =>
{
// Set ConnectionString.
String sConSg =
"CONNSTRING HERE";
using (SqlConnection connection = new SqlConnection(sConSg))
{
try
{
connection.Open();
}
catch (Exception exception)
{
MessageBox.Show(stat.Text = exception.Message);
}
try
{
SqlDataReader slrr = null;
SqlCommand command = new SqlCommand("SELECT ActivationCode FROM CAccounts WHERE ActivationCode = " +
"'" + _activationcode.Text + "'", connection);
slrr = command.ExecuteReader();
while (slrr.Read())
{
if (slrr["ActivationCode"].ToString() == _activationcode.Text)
{
MessageBox.Show(slrr["ActivationCode"].ToString(), "AutoOptimise");
}
else
{
}
}
}
catch (Exception exception)
{
MessageBox.Show(stat.Text = exception.Message);
}
}
});
thread.Start();
Can somebody please shed some light?