AFAIK execute scalar is used to get single value from your query
i.e :
select count(*) from yourtable
If you want multiple columns result, you can use executereader or filling a datatable
ie :
select id, flag from yourtable
Dim reader As SqlDataReader = command.ExecuteReader()
While reader.Read()
Dim imageData As Byte() = DirectCast(reader("Flag"), Byte())
Dim id As Integer = reader("id")
End While
from datatable
Dim imageData As Byte() = DirectCast(dt.Rows(0)("flag"), Byte())
Programming to simplify, don't look for difficult way
Suwandi - Non Graduate Programmer
All-Star
52813 Points
15768 Posts
Re: Retrieving varbinary field from sql query with other fields to picturebox in a windows form
Jun 02, 2017 03:42 AM|oned_gk|LINK
AFAIK execute scalar is used to get single value from your query
i.e :
If you want multiple columns result, you can use executereader or filling a datatable
ie :
from datatable
Suwandi - Non Graduate Programmer