asp.net - Incorrect syntax near ',' (dbnull issue) -
asp.net - Incorrect syntax near ',' (dbnull issue) - it suppose there chart appeared. but, doesnt there problem regarding dbnull issue. happen when either 1 of 3 select statement has no data. dim user string = session("nomatrik") dim resultid object = session("max") dim idquery = "select max(resultid) id tblresult result_nomatric = @matric , result_quiz_id = 1 union " + "select max(resultid) id tblresult result_nomatric = @matric , result_quiz_id = 2 union " + "select max(resultid) id tblresult result_nomatric = @matric , result_quiz_id = 3" conn.open() dim cmdgetid new sqlcommand(idquery, conn) cmdgetid.parameters.addwithvalue("@matric", user) dim maxids sqldatareader = cmdgetid.executereader dim ids string = "" while maxids.read ids += maxids("id").tostring() + ",