.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

programatically pass the connection string to the ssrs reports

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :Sql Server
 
hi... to all
i've created ssrs reports local following is my code..
 public void source(string tbname,string Rptname)
        {
            ReportViewer1.Visible = true;
            string myQuery = "select * from " + tbname;
            SqlConnection myConnection = new SqlConnection(ConnectionString);
            SqlCommand myCommand = new SqlCommand(myQuery, myConnection);
            myCommand.Connection.Open();
            SqlDataAdapter da = new SqlDataAdapter(myCommand);
            DataSet dt = new DataSet();
            da.Fill(dt);


            //ReportParameter[] p = new ReportParameter[1];
            //p[1] = new ReportParameter("@p_dno", "5");
            //this.ReportViewer1.LocalReport.SetParameters(p);

More Related Resource Links

programatically pass the connection string to the ssrs reports

  

hi... to all
i've created ssrs reports local following is my code..
 public void source(string tbname,string Rptname)
        {
            ReportViewer1.Visible = true;
            string myQuery = "select * from " + tbname;
            SqlConnection myConnection = new SqlConnection(ConnectionString);
            SqlCommand myCommand = new SqlCommand(myQuery, myConnection);
            myCommand.Connection.Open();
            SqlDataAdapter da = new SqlDataAdapter(myCommand);
            DataSet dt = new DataSet();
            da.Fill(dt);
            //ReportParameter[] p = new ReportParameter[1];
            //p[1] = new ReportParame

programatically pass the connection string to the ssrs reports

  
hi... to all
i've created ssrs reports local following is my code..
 public void source(string tbname,string Rptname)
        {
            ReportViewer1.Visible = true;
            string myQuery = "select * from " + tbname;
            SqlConnection myConnection = new SqlConnection(ConnectionString);
            SqlCommand myCommand = new SqlCommand(myQuery, myConnection);
            myCommand.Connection.Open();
            SqlDataAdapter da = new SqlDataAdapter(myCommand);
            DataSet dt = new DataSet();
            da.Fill(dt);


            //ReportParameter[] p = new ReportParameter[1];
            //p[1] = new ReportParameter("@p_dno", "5");
            //this.ReportViewer1.LocalReport.SetParameters(p);
 &n

pass Drop down selected value to Texxtbox in SSRS Reports

  
hi, i have developed a ssrs report which as Two dropdown as parameter first one is used to select the Starting year second one is used to select the ending year based upon the selected value a table will retreive data's Above the table there s textbox which is used to give message as "Project From year 2006-2007 " this 2006-2007 must be the dropdown selected how to do this? Thanks, Saraswathy

How can I programatically set a connection string in a datasource

  
I am thinking of putting a drop down list to choose a couple of options.  Depending on what is selected I want to then specify a specific connection string.  I use the ConnectionString="<%$ ConnectionStrings:SomeConnectionString %>" format.  How can I handle this in the .aspx page?

SSIS as data source in SSRS connection string

  

I have a connection string

="/f c:\test\test2\test2\package.dtsx /set \package.variables[User::varfil].Value;" & Parameters!varempid.Value

but its not returning any results. I need a valid connection string.


SQL Connection String

  
We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

abstract away the source of the connection string using a class with a static property.

  
ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Encapsulation
Let's abstract away the source of the connection string using a class with a static property.

connection string question from a newbie

  

when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"


Modifying connection String in Web config using Install Wizard

  

Hey,

Im trying to create a Web Deployment Project, the built in setup and deployment is very good in Visual Studio, i need to able to add an additional step in the setup to change the connection string in the Web config file. Ive seen a lot of articles on how to do this and in particular this http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx#7162670 I am however stuck on the final part of this tutorial, im using the code Scott provided but have two errors,  heres part of my code where the errors are



using System;
using System.Configuration;
using System.Configuration.Install;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.DirectoryServices;

 void ConfigureDatabase(string targetSite, string targetVDir, string connectionString)
        {
            // Retrieve "Friendly Site Name" from IIS for TargetSite
            DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/" + targetSit

Share Point integrated SSRS reports rendering when access from external site

  

Our client has a SharePoint (moss2007) site on Windows 2008, SQL2008 R2 Enterprise, and Reporting service is integrated with SharePoint

The authentication on the share point integration is set to windows, else the authentication for the SSAS datasource gives and error

The extranet zone ( forms) and intranet (Customer Forms) and default (Windows) zones are all access from inside the firewall and the reports render in each with no issues, as the datasources are configured to pass a sql username and password.

However, report rendering is a problem from the internet (external site), the following error is displayed:

 
An unexpected error occurred while connecting to the report server. Verify that the report server is avai

SSRS - Where are the Sharepoint Report Usage Reports provided by Microsoft

  

HI,

Microsoft provided 3 example reports for Sharepoint report usage. Does anyone know where they are located? I used them about 2 years ago.

Thanks.

John.

 


Custom security via connection string

  
Hi Is it possible to pass information into the SQL Server relational engine via the connection string in the same way as it can be done for Analysis Services? I need to generate a user context for a forms authentication application (i.e. no windows user accounts). SSAS allows you to pass in a list of database roles or a customdata parameter on the connection string. These can be used inside the database in lieu of a windows identity. I am wondering if there are equivalent parameters available for the SQL connection string.  I guess that I could create SQL logins from each of the forms users with a system generated password and then pass the uid and password on the connection string but this seems unnecessarily complicated. Andrew Wiles - www.it-workplace.com - MDX made simple

connection string

  
on the computer with sql management installed i use this and it works(server name):  .\SQLEXPRESS the computer name is: MAINCOMPUTER2 another computer on the network would use what? i can see  the c drives on either computer from either computer so i am connected.    

Capture and pass "abc\xyz" as a string into my WCF method

  
Hi All, I am trying to implement WCF Method where client has to pass like "abc\xyz" as a string i have to capture it and pass to my method. I am not able to do it. In our application we can split the string  and we can do what ever we can do . but string comes from client site so who do i capture into my method. I am very much new in WCF. Could u please help me. Thanks Shekhar  

Printing Issue in SSRS reports

  
Hi,   We developed around 70 ssrs reports for our new application.Its like,all the report names are mentioned in the left hand side and if we click it,.Net calls the SSRS reports and shows in the Right hand side.   The issue now is with the Printing.My client complains that they are not able to print the Reports properly.Some of the columns are moved to the next page,it seems.Reports are having different number of columns and we dont know how to resolve this issue.Should I use Landscape or Portrait?..If I give the table's width in the place of Report's width,will it work?    Your help would be greatly appreciated.

Connection string

  
Hi There!I am doing a project using Visual Web Developer Express. I have built a database using MS SQL Server Express which I have installed together with Visual Web Developer Express. Please help me what sort of the connection string I should use in the pages of my website to establish connection to the database.Thank you

A connection could not be made to the report server - Problem deploying an SSRS report from Business

  
I’m having trouble with what seems to be a common issue for people, regarding deployment of an SSRS report from Business Intelligence Development Studio. Unfortunately none of the solution I have seen posted here (and elsewhere) have been able to help me so far.   Two of my collegaues can both deploy with no problem, and I am using exactly the same Target destinations as them (TargetDataSourceFolder, TargetReportFolder, TargetServerURL).   I have posted the error message below, which from my basic understaning would indicate, I think, a security issue (perhaps something local to my PC, or user account)   Has anyone experienced this particular issue who might be able to help?   Best wishes, Jamie TITLE: Microsoft Report Designer ------------------------------ A connection could not be made to the report server http://turpin-net.turpin-bg.local/Reportserver. ------------------------------ ADDITIONAL INFORMATION: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <HTML dir="ltr"> <HEAD><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta HTTP-EQUIV="Content-Type" content="text/html; c
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend