How to connect data base to reportviewer control

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2009
Posts: 21
Reputation: sudharani is an unknown quantity at this point 
Solved Threads: 1
sudharani sudharani is offline Offline
Newbie Poster

How to connect data base to reportviewer control

 
0
  #1
Sep 18th, 2009
Hi friends,
in my website i want to display reports using reportViewer control.
I am not able to connect this report viewer to database.
Please help me in solving this.
Thank U
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 66
Reputation: reach_yousuf is an unknown quantity at this point 
Solved Threads: 12
reach_yousuf reach_yousuf is offline Offline
Junior Poster in Training

Re: How to connect data base to reportviewer control

 
0
  #2
Sep 19th, 2009
Hi,

Use the following code...
  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2. Dim dsTemp As New ProductGridDS
  3. obj = New InventoryBusiness.ProductBusiness
  4. dsTemp = obj.GetProductInfo() 'retrieve your data here in dataset
  5.  
  6. Dim rds As ReportDataSource
  7. rds = New ReportDataSource("ProductGridDS_ProductGridInfo", dsTemp.Tables(0)) 'report name =ProductGridDS_ProductGridInfo
  8.  
  9. ReportViewer1.LocalReport.DataSources.Clear()
  10. ReportViewer1.LocalReport.DataSources.Add(rds)
  11. ReportViewer1.LocalReport.Refresh()
  12. End Sub

Pls. mark as solved if it helps you!!!
Yousuf
Software Developer
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC