SatSheltset
New Member
How do I check to see if the datareader object contains an empty dataset? <BR><BR>Objective: I'd like to show a message if it's empty, else bind it to a dropdown and make that dropdown visible.<BR><BR>I've been looking, but haven't found an example yet. Thanks.heh, yup, there's no .Count for DataReader. leave that to your control, for a dropdown, try<BR><BR>dim rd as SQLDataReader<BR>'put code here to fill your reader<BR>ddlList.datasource = rd<BR>ddlList.databind()<BR><BR>if ddlList.items.count > 0 then<BR>'you have data<BR>else<BR>'you have no data<BR>end if<BR><BR>this will work with grids, datalists, and just about any databound item, but you need to be familiar with each item's ITEM collection..NT = No textThis doesn't work because it tells me"<BR><BR>"Invalid attempt to read data when reader is closed"<BR><BR>Jeez,<BR><BR>How difficult can it be to determine if a record exists or not, and then assign a value to an <asp:image> tag, depending on the result. ie (the field value if record exists, or another value if a record doesn't exist).<BR><BR>This would be a piece of cake with classic ASP.<BR><BR>Any ideas. Thanks.