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();
}
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
Post a Comment