SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
Here's my code:
public
{
cmd.CommandText = query;
cmd.Connection = conn;
objParam1 = cmd.Parameters.Add(
objParam2 = cmd.Parameters.Add(
objParam1.Direction =
objParam2.Direction =
objParam1.Value = txtUsername.Text;
objParam2.Value = txtPassword.Text;
conn.Open();
}