943,701 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 644
  • ASP.NET RSS
Sep 18th, 2009
0

How to connect data base to reportviewer control

Expand Post »
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
Similar Threads
Reputation Points: 7
Solved Threads: 1
Newbie Poster
sudharani is offline Offline
21 posts
since Sep 2009
Sep 19th, 2009
0

Re: How to connect data base to reportviewer control

Hi,

Use the following code...
ASP.NET Syntax (Toggle Plain Text)
  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!!!
Reputation Points: 12
Solved Threads: 38
Junior Poster
reach_yousuf is offline Offline
194 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: helping with dialog / message while uploading
Next Thread in ASP.NET Forum Timeline: Crystal Report Viewer Export, Print and all other icons are not visible on the web





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC