asp.net - Retrieve data from one table that is not in another one -
sq = "select roomno,blockname roommanage roomno not in( select *from availableroom)"; ds = dc.filldata(sq); gridview1.datasource = ds.tables["t1"]; gridview1.databind();
there error:
only 1 expression can specified in select list when subquery not introduced exist
.
how can solve this?
in "not in" should return 1 column. try below code.
sq = "select roomno,blockname roommanage roomno not in( select id availableroom)"; ds = dc.filldata(sq); gridview1.datasource = ds.tables["t1"]; gridview1.databind();
Comments
Post a Comment