public static string change()
{
SqlConnection sqlConnection1 = new SqlConnection("Provider=SQLOLEDB; Data Source=iwsql02.fe-works.com\\TEST; Initial Catalog=nccrt-cs2;User Id=nccrt_cs2;Password=nccrt_cs2;");
SqlCommand cmd = new SqlCommand();
//Object returnValue;
cmd.CommandText = "SELECT PostDate FROM CS_Posts WHERE (ThreadID = 11)";
cmd.CommandType = CommandType.Text;
cmd.Connection = sqlConnection1;
sqlConnection1.Open();
returnValue = cmd.ExecuteScalar();
sqlConnection1.Close();
return returnValue;
}
I am getting the error
The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?
{
SqlConnection sqlConnection1 = new SqlConnection("Provider=SQLOLEDB; Data Source=iwsql02.fe-works.com\\TEST; Initial Catalog=nccrt-cs2;User Id=nccrt_cs2;Password=nccrt_cs2;");
SqlCommand cmd = new SqlCommand();
//Object returnValue;
cmd.CommandText = "SELECT PostDate FROM CS_Posts WHERE (ThreadID = 11)";
cmd.CommandType = CommandType.Text;
cmd.Connection = sqlConnection1;
sqlConnection1.Open();
returnValue = cmd.ExecuteScalar();
sqlConnection1.Close();
return returnValue;
}
I am getting the error
The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?