Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 22, 2013 06:48 PM by bdelacruz
Member
29 Points
12 Posts
Dec 06, 2008 08:21 AM|LINK
Hi
I have created a crystal report by using visual studio 2005 wizard,
and at the time of creating set up i used merge module
so after intallation of my application it put connection string of report in app.cofig
but if i want to change server name than it doesn't reading modified connection string of report
can any body tell me what i am missing
Thanks a lot in advance
Crystal Report deployment Connection string problem
68 Points
9 Posts
Dec 06, 2008 09:25 AM|LINK
use this code in Your Codebehind
Configuration.ConfigurationManager.AppSettings(
26 Points
23 Posts
Nov 15, 2011 05:26 PM|LINK
I'm trying to do this too can you provide me a simple example?
should this code fire on Page Load?
CrystalReport1.DataSourceConnections(0).SetLogon(Configuration.ConfigurationManager.AppSettings("UserId"), _
Configuration.ConfigurationManager.AppSettings("Password"))
or on the ASP page?
2 Points
1 Post
Mar 22, 2013 06:48 PM|LINK
Create the connection on the WEB.CONFIG file under <connectionStrings> section
<connectionStrings> <add name="connsample" connectionString="Data Source=<servername>;Initial Catalog=<database>;User ID=<user>;Password=<password>" providerName="System.Data.SqlClient"/></connectionStrings> . . . </connectionString>
then assign the connection to a session variable or any other variable thru the "configuration manager"
Session("conexion") = New SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings("connsample").ConnectionString)
Now you can use the method "Crystaldatabaselogon" as follow:
crystalReport.SetDatabaseLogon(Session("conexion").UserID, _ Session("conexion").Password, _ Session("conexion").DataSource, _ Session("conexion").InitialCatalog)
And you are ready to go...
ashishpariha...
Member
29 Points
12 Posts
Crystal Report deployment Connection string problem
Dec 06, 2008 08:21 AM|LINK
Hi
I have created a crystal report by using visual studio 2005 wizard,
and at the time of creating set up i used merge module
so after intallation of my application it put connection string of report in app.cofig
but if i want to change server name than it doesn't reading modified connection string of report
can any body tell me what i am missing
Thanks a lot in advance
Crystal Report deployment Connection string problem
prem_spk
Member
68 Points
9 Posts
Re: Crystal Report deployment Connection string problem
Dec 06, 2008 09:25 AM|LINK
use this code in Your Codebehind
CrystalReport1.DataSourceConnections(0).SetLogon(Configuration.ConfigurationManager.AppSettings("UserId"), _Configuration.ConfigurationManager.AppSettings(
"Password"))joefonseca
Member
26 Points
23 Posts
Re: Crystal Report deployment Connection string problem
Nov 15, 2011 05:26 PM|LINK
I'm trying to do this too can you provide me a simple example?
should this code fire on Page Load?
CrystalReport1.DataSourceConnections(0).SetLogon(Configuration.ConfigurationManager.AppSettings("UserId"), _
Configuration.ConfigurationManager.AppSettings("Password"))
or on the ASP page?
bdelacruz
Member
2 Points
1 Post
Re: Crystal Report deployment Connection string problem
Mar 22, 2013 06:48 PM|LINK
Create the connection on the WEB.CONFIG file under <connectionStrings> section
then assign the connection to a session variable or any other variable thru the "configuration manager"
Session("conexion") = New SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings("connsample").ConnectionString)Now you can use the method "Crystaldatabaselogon" as follow:
crystalReport.SetDatabaseLogon(Session("conexion").UserID, _ Session("conexion").Password, _ Session("conexion").DataSource, _ Session("conexion").InitialCatalog)And you are ready to go...