Greetings Everyone,

Can you tell me how to take a query that returns a single row of data and load that data into textbox controls.

I know about ExecuteScalar but it is only good for a single column of data from the query.

Thanks.

Truly,
Emad

Recommended Answers

All 2 Replies

ExecuteReader() method.

...
SqlDataReader dr=cmd.ExecuteReader()
if dr.Read() Then
   TextBox1.Text= dr("col1") & " " & dr("col2")
End IF

Hi adatapost,

Thanks for the help. I'll look up ExecuteReader().

Truly,
Emad

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.