Member Avatar for Dharshika

Can anyone help me to display the data retrieved from SQL server in text area of html in C#

Are you returning just one record from the database or a dataset?
If one record you can place it into the text area using its .Text method (your text area is marked as runat="server" right?). E.g. textArea.Text = dataString;

assuming you returned a string from the database a sample might look like this:

string data = command.ExecuteScalar().ToString();
textArea.Text = data // you can of course do this in one line if you prefer

Returning a dataset is a little bit harder as you need to loop through the rows and concatenate them together for display in the text box.

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.