Solved

Need to fetch information form database table to Vb.NET/ Asp.NEt

Posted on 2011-09-14
1
286 Views
Last Modified: 2012-05-12
Hi,

Two problems:
I have saved all the inforamtion in  a SQL server db table.  Iwant to retrieve the whole information including HTML table , to asp.net page and display  on it as it is. The problem is that I can retrieve on the information all attached togather  with table (tablular information)
There is a psosibly of making  table from scratch , but iti si difficult to separate  information from each and put thenm ni a new table.

Second problem,
This is related with the html table (2*1) stored in database. I am retrieving the information all togather.I want to separate the information of cell 1 (upper cell)  from cell 2 (lowe cell) on aspx page

Soultion urgently required.

0
Comment
Question by:Ammar Iqbal
1 Comment
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 36534909
http://www.developerfusion.com/article/4278/using-adonet-with-sql-server/
http://vb.net-informations.com/ado.net-dataproviders/ado.net-executereader-sqlcommand.htm

Problem 1:

You can bind the datasource into grid. From the grid you can get HTML output:

   StringBuilder sb = new StringBuilder();  
   StringWriter sw = new StringWriter(sb);
   HtmlTextWriter hw = new HtmlTextWriter(sw);  
   gv.RenderControl(hw);    
   return sb.ToString();

If your query output as HTML table then in Javacript (client side) you can use document.write(yourcontent);


Problem 2:

   Better use two queries with semicolon seperated or use SP to return 2 results. I mean multiple result sets then bind them individually.

 Please refer http://vb.net-informations.com/ado.net-dataproviders/ado.net-multiple-result-sets.htm


0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
kill process lock Sql server 9 54
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 33
MS SQL + Insert Into Table - If Doesnt Exist 9 35
vb.net class 3 17
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question