开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜