[Solved] Display data on ASP.NET wep page [closed]


There is no such thing as Console.WriteLine in ASP.NET. ASP.NET is a technology framework built for the Web, not for the Console applications in the Windows.

What you wanted to use would be this

Response.Write(String.Format("{0}, {1}, {2}, {3}, {4} ", 
                             column[0], column[1],  column[2],  column[3],  column[4]));

This would write the content as a Response to the request sent to the server. I would definitely forward you to the ASP.NET forums and there you can find the documentations about the ASP.NET too. You can write the very same result on the ASP.NET web page using many methods, which includes this method (Response.Write) and another method to call the View and generate the result and so on. Depends on how you run it.

http://msdn.microsoft.com/en-us/library/ms525585(v=vs.90).aspx

Why not to use Response.Write()

Technically, this method is available in ASP.NET to write the data. But this is not a good approach, example of this is just like document.write() from JavaScript, it adds the content and overwrite the other data. In ASP.NET it doesn’t do the same, but it prepends the data to the top of the page, so like Console.WriteLine appends, this method prepends the data to the body element.

Instead of this, you can call the result from the Database. And after that you can write the data in the HTML body using Razor syntax like

<div>@A4_Data.Readrowdata</div>

It would provide you with the same result and would be inside the div that you want it to be.

5

solved Display data on ASP.NET wep page [closed]