Solved

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

Posted on 2011-09-14
1
297 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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