ASP.Net VB - Change rows on gridview depending on SQL Query Result
Im trying to change the information on each row depending on the result from the query. Im thinking that at the minute my problem is that I'm only returning the first result from the query into the result.
开发者_开发知识库e.g. query returns row 1 with '1232' row 2 '1243' but result is only ever set to '1232'
I could be wrong but its why I'm here :)
You say that your SQL returns multiple rows, but are using the ExecuteScalar()
to run it. ExecuteScalar will only return a single result, ie the first column of the first row. Sounds like you need to fill a datatable using a SQLDataAdapter
or something else to do what you're looking for.
Also it would be beneficial if you included your SQL statement as rlb indicated.
精彩评论