i hava retrieve the data from database to text box but i am getting only one row from the table i want to retrieve all the rows of a table in the text boxes how it is possible please help me sir.

Recommended Answers

All 3 Replies

without seeing your code its very hard to see what you might need to change.
Please post any code relevant to your question in [code]

[/code] tags.

@anitha10
As a sidenote, I see you have several threads named C#.
Please give your threads a more appropriate name.
It will help us all.:)

As some one else has mentioned include your code. However what I guess you could do is the following:

foreach (datarow dr in dt.rows)
{
txtTextbox.text = txtTextBox.text + "\n" dr[0].tostring() ; 
}

what this does is loop through your rows and adds them to the text box adding a new line as they go denoted by the "\n". Note however that this will only work if you have multiline set to true.

Try this I can't quite remember all the ins and outs and you will have to correct the capital letters etc...

--Taylby

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.