Skip to main content

sql

SqlConnection con = new SqlConnection("Server=VIJAY\\DATASERVER; database=employees;user id=sa;pwd=vb_123");
con.Open();
//Response.Write("connected successfully");
SqlCommand cmd = new SqlCommand("select count(*) from employee",con);
cmd.CommandType = CommandType.Text;
object obj = cmd.ExecuteScalar();
Response.Write(obj);
con.Close();

}

Comments

Popular posts from this blog