This question already has an answer here:

I am getting this error, and it points me to this code:

private int getPlaces(string id)
    {
        string strConnectionString = ConfigurationManager.ConnectionStrings["SilverInfocomm"].ConnectionString;
        SqlConnection myConnect = new SqlConnection(strConnectionString);
        string sql = "SELECT Places FROM SIJ WHERE ID='" + id + "'";
        SqlCommand cmd = new SqlCommand(sql, myConnect);
        myConnect.Open();
        int numrows = (int)cmd.ExecuteScalar();
        myConnect.Close();
        return numrows;
    }

Please help :-(

Related posts

Recent Viewed