The error I am receiving is "Incorrect syntax near 'user'" - however, I cannot see anything wrong with my code - does anyone have any ideas?
protected void Page_Load(object sender, EventArgs e)
{
string db = "";
db = ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString;
SqlConnection con = new SqlConnection(db);
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT * FROM user";
cmd.Connection = con;
SqlDataReader dr;
dr = cmd.ExecuteReader();
while (dr.Read())
{
Response.Write(dr[0].ToString());
Response.Write(dr[1].ToString());
Response.Write(dr[2].ToString());
Response.Write(dr[3].ToString());
}
con.Close();
}
"SELECT * FROM [user]"