How To Use ProviderName, User ID, Password, And Connection Saved In Web.config And SqlDataSource

Jun 1, 2008

Just downloaded and installed the VS 2008 Express and created/tested some websites.   I have done several aspx websites using VS 2005 during the
last 2 years.  Still I don't quite understand the details of coding the database connection and DataBing.  For example, what does 'providerName',
and Integrated Security really mean?

Why in the Web.config file these are providerName="System.Data.SqlClient" and Integrated Security=True?  Why in Default.aspx
there are both ntegrated Security=True;and USER ID=WEB; Password=webwebweb1".  I know these may deal with the authentication mode of my SQL Server
database.

For the VS 2008 Express and SQL Server 2005 Express, I installed in my XP home PC, I used the file system websites,  If I upgrade to XP Pro and install IIS
web server, and use SQL Server 2005, what might be different? 
Jeffrey 
Web.config 
<connectionStrings>
        <add name="NorthwindConnectionString" connectionString="Data Source=D5MRY6G1SQLExpress;Initial Catalog=Northwind;Integrated Security=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
Default.aspx 
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="Data Source=D5MRY6G1SQLExpress;Initial Catalog=Northwind;Integrated Security=True; USER ID=WEB; Password=webwebweb1"
        ProviderName="<%$ ConnectionStrings:NorthwindConnectionString.ProviderName %>"
MasterDetail.aspx 
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    
       

 

View 1 Replies


ADVERTISEMENT

User Id And Password In My Connection String

Aug 15, 2006

Is there a way to find out my user id and password that should be used in my connection string? If I can not find this information out for myself, do I need to go to some type of system administrator.
Here is the connection string in my web.config file.
<connectionStrings>
<add name="SPK" connectionString="Server=localhost; User ID=AppUser;Password=meander;Database=atstdb01;
Persist Security Info=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
 
When I access this connection string via my code, A little dialog box pops up with the following error message:
Login failed for user AppUser. Reason: Not associated with a trusted SQL Server connection.
 

View 2 Replies View Related

Why Can't The Password Be Saved??

Mar 3, 2006

Hi!

I want to modify a package stored on the server from my client machine, and everything goes great.

The only problem I get is that when I try to run it by double-clicking it I have to re-write the password in the connection string, i.e. "pwd=asdasd", because it is not saved by the package itself even though the checkbox in the Connection Manager tab (in the SSIS Designer) is checked. What can I do to save it automatically??

Thanks

View 3 Replies View Related

Password Cannot Be Saved

Apr 10, 2007

Hi, there;
I have a SSIS package which has SQL2005 as its destination. When I setup the connectionmanager, I'd like to use SQL authentication. But I found that the password field cannot be saved (Checkbox "Save password" is selected).Everytime I open the this package's connectionmanager, that password field is cleard. The result is that my C# application that loads that package to execute failed with "Login failed..."

Did I do something wrong or anybody know how to save that password field?

Cheers

View 4 Replies View Related

MS Sql Server User ID, Password And Connection String

Nov 25, 2007

Hi;I am making a software (.Net) which is going to connect a ms sql server but I cant conect yet :(.1- I dont know what I have to type for user id (name)2- What is my password, it has been long time that I hvae installed it but I dont need any password with Microsoft SQL Server Management Studio Express which has windows authentication option. My software can work via internet or network. So I need to know my user name and password. I am using oledbconnection. Do I need any password?3- I visited www.connectionstrings.com already so I have the format of it.Thanks very much for any help...

View 1 Replies View Related

Dynamic OLE DB Connection String With Static User ID And Password

Apr 30, 2008

I'm trying to setup a dynamic ole db connection using the SA user ID, it has to be dynamic because the server name will change and it has to be SA because we're pulling information from system databases that some users don't have access to.

If I setup a regular static connection using SA credentials it works like a charm of course. When I create an expression to use the User:erver variable it doesn't work, it throws an error message saying that "The login failed for user sa" among other things, I'm thiking that the sa's password is not being saved.

Where exactly do I place a password for dynamic connections using sql server users? On the connection string? On the password property of the source? Any ideas?

View 1 Replies View Related

ODBC Password Not Saved In Configuration File

Apr 19, 2006

Hi,
 
I have an SSIS package that pipes data from an iSeries data source to a SQL Server table. The connection manager I am using is the .Net ProvidersOdbc Data Provider
 
When I run this SSIS package on my developer PC (from inside BIDS or using the Management Studio Execute Package Utility) it works. However when I run the package from within a SQL Server Agent Job it fails.
 
I have enabled logging and the error message given is:
System.Data.Odbc.OdbcException: ERROR [28000] [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8002 - CWBSY0002 - Password for user MALLPRESS on server SMICHC is not correct, Password length = 0, Prompt Mode = Never, System IP Address = 172.16.0.4  ERROR [28000] [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8002 - CWBSY0002 - Password for user MALLPRESS on server SMICHC is not correct, Password length = 0, Prompt Mode = Never, System IP Address = 172.16.0.4
It gives the message €œPassword length = 0€? despite the fact that I have specified a password in the package.
 
To try to get around this I have added an XML configuration file to the SSIS package. In this configuration file I€™ve set values for the ConnectionString, UserName, and Password.
I still get the above error about a password length of 0.
 
I have also tried to execute the package using dtexec, but this gives a similar error.
The SQL used to run this is:
xp_cmdshell 'dtexec /sq "SCSRV-06DTS PackagesStagingStagingBranchImport"'
 
This has got me stumped, and I€™m not sure where to go from here as these packages need to be programmatically run each morning. At the moment I am manually running them from within BIDS.
All packages that don€™t use an iSeries connection manager run successfully in SQL Agent jobs.
I have also tried using the OLEDB connection manager (ibm db2 udb for iseries ibmda400 ole db provider) without success.
 
Any help would be very appreciated.
 
Thanks, Matt

View 5 Replies View Related

Password In Config File

Nov 6, 2006

Hi

Config files doesn't seem to work for me :( i want to make a common config file for all of my packages but it is giving me error

Validation error. The AcquireConnection method call to the connection manager failed with error code 0xC0202009

I have placed pasword in my config file too. Following is config file which i m using, server name n password are masked.



<?xml version="1.0"?>
<DTSConfiguration>
<DTSConfigurationHeading>
<DTSConfigurationFileInfo GeneratedBy="SSBKD955688" GeneratedFromPackageName="DTS_ACPM_MarkIT_Indices_Composites_TRAC_X_Asia_Index" GeneratedFromPackageID="{CB3660A1-5E6C-4D08-A7F5-4D6CE83578E2}" GeneratedDate="2006/10/19 14:05:20"/>
</DTSConfigurationHeading>
<Configuration ConfiguredType="Property" Path="Package.Connections[ssmgn838.ACPM.acpmuser].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>server=########;user id=sa;password=******;database=ACPM;
</ConfiguredValue>
</Configuration>
<Configuration ConfiguredType="Property" Path="Package.Connections[Text File (Source)].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>C:acpmfiletouploadCopy of ACPM_MarkIT_Indices_Constituents_Composites_1_ITRAXX_ASIA.tab
</ConfiguredValue>
</Configuration>
</DTSConfiguration>

View 3 Replies View Related

Rsreportserver.config Smtp Password Settings

Dec 22, 2005

 

Hi,
  I wanted to know if there was any way of setting the SMTPAuthenticate in the RSReportServer.config file, so i could connect to a remote SMTP with username and password ?

I am using window 2003 system where smtp is not installed  and i don't want to installed it.

If there is another way to change only in Rsreportserver.config  file except pick up directory.

thanks in advance

Ashok kumar yadav

View 14 Replies View Related

Is It Possiable To Store Password Encrypted To An External Config File?

Jun 2, 2006

I got a problem when developing SSIS packages.

For security reason, the sensitive information must be encrypted, and they should be configurable dynamically (by an ASP.NET application).

so I tried several ways to achieve this,

1. use SSIS Package Configurations to generate an XML config file
It's a convenient way to generate config file. but the passwords are not encrypted (or I don't know how).

2. use Variables and Property Expressions
I can set variables by reading from an external custom xml config file which was content encrypted (read and decrypt the custom config file in a script task). but in a FTP Connection Manager entity, the Password property can not be set via Property Expressions.

Is any way to store password encrypted to an external file?

View 1 Replies View Related

SQLdatasource Config Wizard Wont Allow Stored Proc As An Option?

Apr 17, 2007

Thanks for your time: 
Using the SQLdatasource wizard, selecting "Specify a custom statement or Stored Procedure", but the "Stored Procedure" radio button and drop box are NOT enabled (greyed out) and cant be selected.  Login has sa and no schema's are implemetned yet... Help?
Is there a setting I'm missing? (like how table needs a primary key set for wizard to allow auto-generate statements)
Otherwise, Is there a work-around I can use?

View 1 Replies View Related

Deleteing Columns From A Saved Fixed Width File Connection Object

Jun 12, 2006

How do I delete columns in a fixed width column file connection object, after I've saved it I can't remove columns anymore?

View 1 Replies View Related

DB Engine :: Extract All Privileges And User Password For A User In DDL Format For Server?

Jul 12, 2010

My goal is to write a DR plan where i am restoring all user databases onto a diffrent server in a event of hardware failure. I was trying to figure out a way to extract DDL of user accounts and their permissions on all user databases so i can simplify my DR documentation. 
 
This is the plan I came up with...to restore all system and user dbs on a different Physical SQLServer.

1. build named instance $PROD

2. restore master database

    - startup sqlserver in single user mode -m or DAC sqlcmd -S ServerName -U sa -P<xxx> –A
    net stop MSSQLSERVER$PROD
    net start MSSQLSERVER$PROD -m
    - restore database master from disk e:master.bak with replace;
   
3. start sqlserver normally

4. stop SQLServer agent

5. restore msdb

-restore database msdb disk e:msdb.bak with replace;

6. restart SQLServer

7. Restore User Databases.

8. Run Sp_change_users_login for all users

-Sp_Change_users_logins 'auto_fix','username'

View 7 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path. Please Make Sure The User Has A Local User Profile On The Computer. The Connection Will Be Closed

Dec 7, 2006

This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee

View 3 Replies View Related

Connection Strings, Trusted-connection VS Username-password, SQL Server 2005 Express

Mar 9, 2007

All --
Please help.
I have some questions about connection strings.
 
BACKGROUND...

Note that I am using the "SQL Native Client OLE DB Provider", SQL Sever 2005 Express, ASP.NET, C#.NET, and VS.NET 2005.
Note that I do not want to use the "Attach a database file" type of connection string.
Note that I am using the site http://www.ConnectionStrings.com as a reference.
Note that this "Standard security" connection string...<add name="LocalSqlServer" connectionString="Server=MYTESTOFFICESERVERS;Database=MyDatabase;Uid=MyDatabaseUser;Pwd=MyDatabasePassword;" />...does not work and causes the following run-time error...A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Note that this "Trusted connection" connection string...<add name="LocalSqlServer" connectionString="Server=MYTESTOFFICESERVERS;Database=MyDatabase;Trusted_Connection=yes;" />...works but is less-than ideal because it uses a Trusted Connection rather than a Username/Password combination.
 
QUESTIONS...
(A) What exactly does the error in Item 4 mean?
(B) Do 4 and 5 imply that one must use a Trusted_Connection for all SQL Server 2005 Express connection strings when the database does not reside in the web application's App_Data folder or use a "Attach a database file" type of connection string?
(C) Are there any alternatives?
(D) What do you suggest?
 
Please advise.
Thank you.
-- Mark Kamoski

View 1 Replies View Related

Get SQL Connection For SQL Config From XML

May 30, 2007

Hi

In toder to make my SSIS packages portable, I need to be able to set connection string to sql package configuration. I thought I can do that via XML package, problem is, at execution time SQL server package configuration is queried first, then variables from XML.
This way, I have no chance to set connection via XML.
Any ideas on how to aproach this ?
(I want to have as much configuration on SQL server so I can modify it easily from future GUI application.

best regards

View 4 Replies View Related

Where Are The SSI Files Saved When Saved To The Server?

Apr 20, 2006

This is a pretty simple question, but I'm going nuts trying to find the answer. After creating an SSI package, I told it to save to the SQL server... Now where do I go to pull that package up again and make changes and/or execute the package?

View 4 Replies View Related

SSIS Package Does Not Remember Password (OLE DB Connection + ADO.Net Connection)

Mar 29, 2007

Both the OLE DB Connection and ADO.Net Connection in SSIS Package does not remember password.

Im connecting to a SQL Server 2000 box using its sa password as test.

The SSIS package runs fine when you first set up the connection in bids

The bottom line is that SSIS keeps forgetting the password I feed into
the two Connections that I'm using. I double-click a connection,
type the password in, check "Save my password" and hit "OK" but the
password disappears from there whenever I run the package or
double-click the connection again.



is there any known workaround for this issue as I would like to schedule my SSIS package using a SSIS Step in a SQL Server 2005 Agent job.



the only thing I found when googling this error was link below but the workaround described here is a little harsh

http://www.developersdex.com/sql/message.asp?p=1921&ID=%3C1146409399.447345.7470@j73g2000cwa.googlegroups.com%3E




thanks in advance

Dave



the box SSIS is running on is Windows 2003 Server Standard Edition latest service pack

SQL Server 2005 (no service packs )





View 14 Replies View Related

Connection Strings In Web.config

May 31, 2007

What am I doing wrong?
This works:
SQLConn.ConnectionString = "Data Source=McD_DB;Initial Catalog=McDFeelGood;User ID=uuu;Password=ppp"
Now I want to put it in my web.config, but these don't work ("ConnectionString property has not been initialized"):
SQLConn.ConnectionString = ConfigurationSettings.AppSettings("McDFeelGoodConnectionString") (VS IDE says this method is obsolete)SQLConn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("McDFeelGoodConnectionString")
<connectionStrings>    <add name="McDFeelGoodConnectionString" connectionString="Data Source=McD_DB;Initial Catalog=McDFeelGood;Persist Security Info=True;User ID=uuu;Password=ppp" providerName="System.Data.SqlClient" /></connectionStrings>

View 1 Replies View Related

SQL Connection Web Config Error

Feb 12, 2006

hey guys i keep getting this error and I am not sure how to sort it and google just aint working for me tonight.
Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.




Line 31: SqlDbType.VarChar, 40))
Line 32: objCmd.Parameters("@IssueName").Value = IssueName.Text
Line 33: objCmd.Connection.Open()
Line 34: ' Test whether the new row can be added and display the
Line 35: ' appropriate message box to the user.




[InvalidOperationException: The ConnectionString property has not been initialized.]
System.Data.SqlClient.SqlConnection.PermissionDemand() +852131
System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) +22
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
ASP.newpriority_aspx.submit(Object Source, EventArgs e) in C:Prototypeofficial1htmlewpriority.aspx:33
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +105
System.Web.UI.HtmlControls.HtmlInputButton.RaisePostBackEvent(String eventArgument) +106
System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

the web config con string is like so
 
<______________>
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<connectionStrings>
<add name="GeolinkSupportdb" connectionString="Data Source=.SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|ASPNETDB.MDF" />
</connectionStrings>

<system.web>

<authentication mode="Forms" />
<roleManager defaultProvider="SqlProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All" >
<providers>
<add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="GeolinkSupportdb"
applicationName="SampleApplication" />
</providers>
</roleManager>

<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="GeolinkSupportdb"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0" />
</providers>
</membership>
 
</system.web>
</configuration>
 
<------------------------------>
code
 
<% @Import Namespace="System.Data" %>
<% @Import Namespace = "System.Data.SqlClient" %>
<% @Import Namespace="System.Text" %>
<% @Import Namespace="System.IO" %>
<% @Import Namespace="System.Web.UI.HtmlControls" %>
<script language="VB" runat="server">

Dim strConnection as string = ConfigurationSettings.AppSettings("GeolinkSupportdb")
Dim sqlConn = New SqlConnection(strConnection)
Sub Page_Load(sender as Object, e as EventArgs)

End Sub
 
Sub submit(Source As Object, e As EventArgs)
'assign the user entered information
Dim objCmd As SqlCommand
'Dim dbIssueName = IssueName.Text
'You must open the connection before populating the DataReader
Dim strSQL1 = "Insert into Support_Issue Values @IssueName"
'SqlConn.Open()
objCmd = New SQLCommand(strSQL1, SqlConn)
objCmd.Parameters.Add(New SqlParameter("@IssueName", _
SqlDbType.VarChar, 40))
objCmd.Parameters("@IssueName").Value = IssueName.Text
objCmd.Connection.Open()
' Test whether the new row can be added and display the
' appropriate message box to the user.
Try
objCmd.ExecuteNonQuery()
Message.InnerHtml = "<b>Record Added</b><br>" & strSQL1
Catch ex As SqlException
If ex.Number = 2627 Then
Message.InnerHtml = "ERROR: A record already exists with " _
& "the same primary key"
Else
Message.InnerHtml = "ERROR: Could not add record, please " _
& "ensure the fields are correctly filled out"
Message.Style("color") = "red"
End If
End Try
objCmd.Connection.Close()
End Sub
</script>
database looks like this
IssueID      UniqueIdentifer
IssueName   varchar(50)
 
Any idea on why I cannot get my connection string to work have I missed something or trying to connect to it wrongly?

View 9 Replies View Related

Config And Connection String

Apr 26, 2007



I want to store my connection string in a configuration file, however when I create the config file the connection string password is not stored. I can manually edit my config file and add the password to my connection string but I am sure that BIDS has a better solution. What is the best practice for storing connection string passwords in my SSIS Configuration files?

View 12 Replies View Related

Can't Retrieve Connection String From Web.config - ASP.NET 2.0

Aug 1, 2007

All,
 I don't know what is the problem, i am not able to retrieve connection string from web.config  in my code behind page
I used every solution provided by people in differents forums.
can anybody help me with this.I used
WebConfigurationManager.OpenWebConfiguration("/TimeSheetApplication").ConnectionStrings("TimeSheetConnectionString").ConnectionString;
WebConfigurationManager.ConnectionStrings("TConnectionString").ConnectionString;

View 5 Replies View Related

Using The Web Config File To Set The Connection String In Asp.net 1.1

Sep 26, 2007

Currently we have a 1.1 app that sets the connection string as a Application variable, we are wanting to change that and place it in the web config file, when I do this  in 2.0 it's a simple process but in 1.1 it's different.  It doesnt seem to like the <connection string> tag, does it go in the appsettings tag and if so what should it look like and how is it referenced.

View 2 Replies View Related

Config File/ Connection Strings

Sep 27, 2007


Hello


I made certain changes in the properties in my Config file and by Change the ServerName and Database Name.
below is the example

When i execute the package it still runs. I mean theer is no server or database with that name but it still works.


<Configuration ConfiguredType="Property" Path="Package.Connections[ConManName].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=UHS137;Initial Catalog=UH_IntegrationStaging;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue>
</Configuration>



Changed to


<Configuration ConfiguredType="Property" Path="Package.Connections[ConManName].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=NOSvr;Initial Catalog=NOdB;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue>
</Configuration>


Then I created a new config file in which I checked in the box for ServerNam and when i change the name teher in the Config file

EXAMPLE


<Configuration ConfiguredType="Property" Path="Package.Connections[ConManName].Properties[ServerName]" ValueType="String">

<ConfiguredValue>NoSvr</ConfiguredValue>

and when executed teh package its fails.

Thats what I neede


SO coming to my question.
1)What is it doing. I mean how is the package talking to this config file
2) Irrespective of what I do in the Connection String the package executes fine, which It should not do as far as my understanding goes. Why is it doesn't matter whats in String. where as it matter in later.









View 5 Replies View Related

Sybase Connection In Xml Config File - Help

Jan 31, 2007

Hi all

I'm trying to connect to a Sybase DB using an OLE DB connection. Now, it works fine when I run the project without the package config enabled, but when I add the Sybase connection to the xml config file, & enable it the connection fails.

This is the error I see in the progress Tab

[Connection manager "AcidPrd.basketUser"] Error: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "ASE OLE DB Provider" Hresult: 0x80004005 Description: "Login Failed. Check for valid user ID, server name and password.". An OLE DB record is available. Source: "ASE OLE DB Provider" Hresult: 0x80004005 Description: "[Native Error code: 4002] [DataDirect ADO Sybase Provider] Login failed. ".

Can anyone help.

Thanks,

Jon

View 6 Replies View Related

This Has Baffled Me For Years: What Is ProviderName=System.Data.SqlClient/&> ???

Apr 6, 2008

Hello,
I see the following in connection strings all the time:       providerName="System.Data.SqlClient"/>
 For example:<connectionStrings><add name="classifiedsConnection" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/></connectionStrings>
What is providerName="System.Data.SqlClient" ?  What is it used for?Thanks, Jim 
 

View 3 Replies View Related

When To Code 'providerName=System.Data.SqlClient In ConnectionStrings, Or Not To?

May 31, 2008

Yesterday, in response to an error msg (something like Login failed for user ''), I deleted the 'providerName=System.Data.SqlClient'in my connectionStrings from Web.config.  Then the aspx website worked.I understand that the value "System.Data.SqlClient" specifies that ASP.NET should
use the ADO.NET provider System.Data.SqlClient
when making a connection.  Why deleting providerName solved the error?  Jeffrey 

View 2 Replies View Related

How To Change The Connection String In A Web.config File

Mar 9, 2007

I've recently uploaded my website, http://www.bigredsongbus.com, to my host. Unfortunately, they don't support the use of SQL Server Express. So, I've purchased an addon through my host - discountasp.net. I've attached my database file to their server, now all that I need to do is to change the connection string in my .config file so that it points to the SQL Server. I don't know how to do this. Any help, please?Jeffrey Way 

View 2 Replies View Related

Referring To Sql Connection String In Web.config From Code Behind

May 15, 2007

Every time I move my project from my computer to the testing server I have to change the connection string references in the aspx side and in my code behind.
For the code behind I declared the SqlConnection string at the top of the code-behind page for both connection strings and comment out the one not in use. Obviously I then comment out the string not in use in the WebConfig as well.
Being superlatively lazy I always look for the easiest and quickest way to do most anything - connection strings included. Having to comment out strings twice brought rise to the question of whether I can refer to the connection string in the web.config file from the code-behind page. I'm sure it can be done, and I did a good amount of hunting around, but I couldn't find any examples of code that would do that.
Currently, as I said above, I have two connection strings declared at the top of my code-behind. Here's an example of one:Private sqlConn As New SqlConnection("Data Source=DATABASESERVER;Initial Catalog=DATABASE;User ID=USER;Password=PASSWORD")
 Then, I just use sqlConn as usual in my binding without having to "dim" it in every sub:sdaPersonnel = New SqlDataAdapter(strSqlPersonnel, sqlConn)
 Then there's the SqlConnections set up by the wizard on the aspx side:<asp:SqlDataSource ID="sqlDataSourcePayrollCompany" Runat="Server" ConnectionString="<%$ ConnectionStrings:DATABASECONNECTIONSTRING %>" ...>
 And for the connection in the web.config:<add name="DATABASECONNECTIONSTRING" connectionString="Data Source=DATABASESERVER;Initial Catalog=DATABASE;User ID=USER;Password=PASSWORD" providerName="System.Data.SqlClient" />
 So, what would be the code in the code-behind page to refer to the connection string in the web.config file?
Thanks!

View 2 Replies View Related

Using Web.config Connection Strings In Code Behind Files

Jul 2, 2007

in asp usually i have code behind files those .aspx.vb file.can i make use of connection strings in there? i am not really familiar with connection strings. actually shouldn't code behind files "simulate" code being in the .aspx file themselves? i seem to not able to share variables between them? 

View 2 Replies View Related

Windows Authentication Connection String In Web.config

Sep 1, 2004

How to add windows authentication connection string in web.config? My SQL server is WebServer, database is ORDER

View 1 Replies View Related

String Connection... At DataAccess Tier Or Web.config???

Mar 4, 2006

How can
ConfigurationManager.ConnectionStrings.Item("ConnectionString").ConnectionString
be embedded in the declaration of sqldatasource?
Thanks.

View 1 Replies View Related

SSIS Connection Error When Using Config File

Dec 17, 2007

Hi

I am developing one SSIS package to migrate an Oracle Database to SQL Server 2005 DB through ODBC. My problem is with configuration. I have to use configuration file so that in production environment the end-user must be able to change the user credentials to connect both database servers. I am trying xml configuration file. When I try to use xml configuration, my odbc connection is giving error. But if I disable the configuration through "Package Configurations Organizer", it works fine. Using an XML Editor I checked the .dtsconfig file and entered both passwords for the both connections.

I tried logging and below are the few text from log file related to error.




Code Block
User:Diagnostic, Nebu, BLRDOMNebu, DestOdbcConnection,{E3535ED4-1D21-41B9-9796-E9F5B47FFD5B}, {6820E259-18FF-4FCA-B820-73EE931D2095},12/17/2007 8:16:39 PM,12/17/2007 8:16:39 PM,0,0x,ExternalRequest_pre: The object is ready to make the following external request: 'IDbConnection.Open'.

User:Diagnostic,Nebu, BLRDOMNebu, DestOdbcConnection,{E3535ED4-1D21-41B9-9796-E9F5B47FFD5B},{6820E259-18FF-4FCA-B820-73EE931D2095},12/17/2007 8:16:41 PM,12/17/2007 8:16:41 PM,0,0x,ExternalRequest_post: 'IDbConnection.Open failed'. The external request has completed.






I am using Protection level = EncryptSensitiveWithPassword for the package.

Please help me.

Thanks & Regards

Charmis

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved