I am trying to populate a GridView using a method called PopulateGrid() (below) but keep getting the same server error "Must Declare the scalar variable "@QUALID&q
This:
cmd.Parameters.Add(new SqlParameter("QUALID", val));
should be this:
cmd.Parameters.Add(new SqlParameter("@QUALID", val));
Sorry, typed too quick, try:
cmd.Parameters.AddWithValue("@QUALID", val);
OK, you have a slightly more fundamental issue in your code. You create a command object, but then you pass the SQL string and the connection for the command into your dataadapter, where it will execute your sql string with no parameters on it's connection.
I haven't used dataadapters too much, but I think you need to set the parameters on the select command of your adapter.