Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void NumOfUsrBtn_Click(object sender, EventArgs e)
- {
- using (var conn = new SqlConnection(sc))
- {
- string UsrNumSQL = "SELECT COUNT (UsrID)FROM UserInfo WHERE 1=1 AND Country = @cou AND State=@sta";
- using (var cmd = new SqlCommand(UsrNumSQL, conn))
- {
- cmd.CommandType = CommandType.Text;
- cmd.CommandTimeout = 10000;
- string condition = "";
- if (worlddrdolist.SelectedValue != "")
- {
- condition += " and Country='" + worlddrdolist.SelectedValue + "'";
- }
- if (staatddl.SelectedValue != "")
- {
- condition += " and State='" + staatddl.SelectedValue + "'";
- }
- cmd.Connection.Open();
- NumbOfUsersLbl.Text = cmd.ExecuteScalar().ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement