Click here to Skip to main content
13,006,281 members (72,464 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Please i have the following text boxes on my aspx form corresponding to fields on a table named;
txtClientID, txtFirstName,txtLastName, txtDOB, txtDateRegistered,txtExpiryDate
I want to retrieve data stored in the corresponding fields in an sql server 2005 database table named;ClientDatails
I want to use DataReader to achieve this can you please help me
Posted 12-Mar-12 2:05am
Updated 12-Mar-12 2:08am
ChandraRam 12-Mar-12 8:08am
What have you tried so far? Post your code and say where you are stuck...
pashad 12-Mar-12 8:09am
Dont use capital letters.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Dim cnPodaci AsNew SqlConnection
cnPodaci.ConnectionString = "your connection string"
Dim cm AsNew SqlCommand
cm.CommandText = "SELECT * FROM TABLE"
cm.Connection = cnPodaci
Dim dr As SqlDataReader
dr = cm.ExecuteReader
If dr.HasRows Then
txtBox1.text = dr.Item("ColumnName1")
txtBox2.text = dr.Item("ColumnName2")
Member 9971240 20-Apr-13 14:43pm
Thank you very much!
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

read this[^]!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170628.1 | Last Updated 12 Mar 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100