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


ADVERTISEMENT

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

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

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

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

Dynamic Connection String (config File)

Dec 8, 2005

Hi,

View 3 Replies View Related

Web.config Connection String Being Used Based Off Enviroment Or Domain?

Feb 20, 2007

I used 3 seperate web.config files - one for Development seerver, one for Certification server, and one for Production server.  The only difference between these three is the within the <connectionStrings> tags. 
For Example:
<connectionStrings><add name="strConn" connectionString="server=xxx;uid=xxxx;pwd=xxxxx;database=yyy;"/></connectionStrings>
Within Development the connectionString points to the Development SQL server, Cert to cert SQL, and Prod to Prod SQL.  I do not have permissions to copy new Web.Config files into Cert or Prod, so when I have a change within my web.config I have to have another group manually add these files.
Is there a way to identify the domain I am curernt within and use a specific set of connections string within the web.config based off this information.  If so, can anyone post an example of how to do this...
 

View 3 Replies View Related

Referring To Function Results In Connection Manager

Nov 9, 2007



Hello! My group uses scalar-valued functions to denote the FTP drives on our SQL Server 2005 database servers. This allows many (over 100) import processes to refer to that function to find the flat files they need, and if the FTP drive is changed, then only the function needs to be updated, not 100 SP's.

The function is defined this way. Currently, F: is our FTP drive:

CREATE FUNCTION [dbo].[fnFTPPath] ()
RETURNS varchar(200) AS
BEGIN

return 'f:'
END


Now the question: Can a Flat File Connection Manager be used in an SSIS ETL package that refers to the output of this function, plus the FTP folder name, so we can continue updating the FTP drive name in just one place? If so, how is this done?

Thank you!

View 1 Replies View Related

Connection String Designer Code

May 2, 2008

I currently have the following code in my designer file
<asp:SqlDataSource ID="SqlDataSource1" Runat="server" SelectCommand="select Site_name, system_id, ASP_Archive, sitetimes,HPOV_ROC, UPPER(CircuitType) as CircuitType, QwestCircuit_ID, SiteConfig,Site_Nat, PVC_VCI from tblASPCustomerWan order by Asp_Archive asc"
UpdateCommand="UPDATE tblASPCustomerWan SET [Site_name] = @Site_name, [system_id] = @system_id, [ASP_Archive] = @ASP_Archive, [sitetimes] = @sitetimes, [HPOV_ROC] = @HPOV_ROC, [CircuitType] = @CircuitType, [QwestCircuit_ID] = @QwestCircuit_ID, [SiteConfig]= @SiteConfig, [Site_Nat]=@Site_Nat,[PVC_VCI]=@PVC_VCI"
ConnectionString="server=localhost;Trusted_Connection=yes;uid=portal_user;pwd=Cr@zyP@55w0rd;database=CusPortal_Staging" />
I would like the change the connection so it takes it value from System.Configuration.ConfigurationManager.AppSettings("appStrConnection"), how can i do that??

View 1 Replies View Related

How To Copy Connection String Code

Apr 19, 2008



hi,

i was able to succesfully configure my remote server over the internet and tried using express edition to connect to my remote server and everything when successful.

is there a way to copy that connection string used to connect to my remote server so as i wanted to create a project in vb using that connection string..

where can i find the connection string code used for my connection remotely ..

i am using express to connect to my sql server

thanks

View 4 Replies View Related

Connection String And Permission Errors In The CLR Code

Feb 28, 2008

I have written a CLR function in C# to access a sql server different from the current server where I have deplyed the assembly.


DataSet ds = new DataSet();





SqlCommand sqlCmd = new SqlCommand();

sqlCmd.CommandType = CommandType.StoredProcedure;

string connString = "Data Source=SQLSERVER;Initial Catalog=DATABASE;User ID=userid;Password=password;";

SqlConnection sqlConn = new SqlConnection(connString);

sqlCmd.Connection = sqlConn;

sqlConn.Open();

try

{

SqlDataAdapter sda = new SqlDataAdapter();

sqlCmd.CommandText = "StoredProcedureName";

sqlCmd.Parameters.Add("@Param1", SqlDbType.VarChar);

sqlCmd.Parameters["@Param1"].Value = sParam1;

sda.SelectCommand = sqlCmd;

sda.Fill(ds);

}

finally

{

sqlConn.Close();

}

return ds;

I was getting the following error

"Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

so I tried doing the following


SqlClientPermission pSql = new SqlClientPermission(System.Security.Permissions.PermissionState.Unrestricted);

pSql.Assert();



and then I get this error


"Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."


Any idea how to remedy this ?

Thanks in advance
- Kan

View 4 Replies View Related

Code For Connection String Using Sql Server 2000 As Backend With Asp.net 1.1 Along With Vb.net

Apr 15, 2008

Hi all,
Please help me for the code of connectivity
it was working fine,but,when i hav written code for validation for id n password,its showing error as
Violation of PRIMARY KEY constraint 'PK_Login'. Cannot insert duplicate key in object 'login_detail'. The statement has been terminated.
 Here is my code given below.
 Please help me
Imports System
Imports System.IO
Imports System.Xml
Imports System.Text
Imports System.Security.Cryptography
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.SqlClientPublic Class WebForm1
Inherits System.Web.UI.Page#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End SubProtected WithEvents txtUser As System.Web.UI.WebControls.TextBox
Protected WithEvents txtPwd As System.Web.UI.WebControls.TextBoxProtected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents lblError As System.Web.UI.WebControls.Label
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End RegionPrivate Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
 Dim objConn As SqlClient.SqlConnection
Dim ds As New DataSetDim m_strConnection As String = "server=172.16.152.17;Database=Trial;UID=abhi_Asset4;PWD=L!nux001;Connect Timeout=100"objConn = New SqlClient.SqlConnection
objConn.ConnectionString = m_strConnection
objConn.Open()
Dim strSQL As String
strSQL = "insert into login_detail(UserID,Password) values('" + txtUser.Text + "','" + txtPwd.Text + "')"Dim objCommand As SqlClient.SqlCommandobjCommand = New SqlClient.SqlCommand(strSQL, objConn)
objCommand.CommandText = strSQL
objCommand.ExecuteNonQuery()
objConn.Close()
 
 
 
 
End SubPrivate Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If (txtUser.Text.Trim() = "") Then
lblError.Text = "UserID should not be blank"
ElseIf (Convert.ToInt32(txtUser.Text.Length) < 5) Then
lblError.Text = "UserID length must be more than 5"
ElseIf (Convert.ToInt32(txtUser.Text.Length) > 20) Then
lblError.Text = "UserID length must not be greater than 20"
ElseIf (txtPwd.Text.Trim() = "") Then
lblError.Text = "Password should not be blank"
ElseIf (Convert.ToInt32(txtPwd.Text.Length) < 5) Then
lblError.Text = "Password length must be more than 5"
ElseIf (Convert.ToInt32(txtPwd.Text.Length) > 20) Then
lblError.Text = "Password length must not be greater than 20"
Else
Server.Transfer("Success.aspx")
End IfEnd Sub
End Class
 
 

View 1 Replies View Related

Reporting Services :: Parsing SSRS Config File And Dynamically Changing File Path Of Config File In Code

Sep 2, 2015

Currently have a single hard coded file path to the SSRS config file which parses the file and provides the reporting services web service url.  My question is how would i run this same query against 100s of servers that may or may not share the same file path as the one hard coded ?

Is there a way to query the registry to find the location of the config file of any server ? which could be on D, E, F, H, etc. 

I know I can string together the address followed by "reports" and named instance if needed, but some instances may not have used the default virtual directory name (Reports).

Am I going about this the hard way ? Is there a location where the web service url exists in a table ? I could not locate anything in the Reporting service database. Basically need to inventory all of my reporting services url's.

View 2 Replies View Related

Config Files For .Net Code In Managed Sprocs

Oct 3, 2006

I have been attempting to create a managed stored procedure which calls a web service using WSE 3.0 for security.

It appears that the WSE-generated config file (or possibly the app.config file) is not accessible to the .Net code.

Is there a method for using config files with CLR managed sprocs?


Thanks,
Max

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

Cannot Set Connection Property Of Backup Database Task If Connection String Is Customized In Connection Object

Aug 23, 2006

I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.

Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.

Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.

Is this an intrinsic issue?

View 2 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 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

ReporItems Referring To A Cell Containing A Subreport?

Mar 28, 2006

Hi guys,

i have a column in a report that must calculate a percentage based on two columns that follow them. I am aware that i can use the ReportItems! collection for this, but one of the columns i need to reference is actually a subreport because its data comes from a different source. It is just a single cell subreport, which makes it appear totally part of the table it is in. Is this possible? Just to be clear, what i want is an expression like this in my cell:



= FormatPercent( ReportItems!CurrentEarnings / ReportItems!BudgetedEarnings )



the BudgetedEarnings cell is actually a subreport, but all i want is the text it is showing.



Thanks for any help or suggestions!

sluggy

View 4 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

Web.config, ConnectionStrings And SQL Named Instances Over A VPN Connection

Aug 29, 2007

Ok, here's the deal. This has been killing me for months now.

Here's the setup - SQL 2000 database on a Shared Infrastructure (cluster). I have a database on a named instance. My port number is xxxxx. I have dbo (through Windows Auth) permissions on my database. When I connect at the office, I get through fine, no question. When I connect at home, I get error 26 in my asp.net 2 app (using System.Data.SqlClient), cannot find SQL Server database. I can connect through the SQL 2005 Management Studio using the same servernameinstance name I use at the office. I can connect through the SQL 2000 Query Analyzer using servernameinstancename;(semicolon)portnumber. I've tried all sorts of combinations in my web.config -
servernameinstancename,(comma) portnumber
servernameinstancename;(semicolon - causes web.config to blowup) portnumber
ipaddressinstancename, (comma) portnumber

and i still get nothing. usually it's 'error 26' - but if i use this:


Data Source=ipaddressinstancename,portnumber;Network Library=DBMSSOCN;Initial Catalog=xxx;Trusted_Connection=Yes;

I get 'Login failed for user domainuser'

I've tried making an alias. I've tried using ODBC. I've even tried a freakin' DSN. No dice.

Nothing seems to work - I'm at the end of my rope. Can someone please help?

View 4 Replies View Related

Retreiving Connection Strings From Machine.config

May 12, 2006

Hi,

I'm trying to figure out how to retreive connection strings from the machine.config instead of storing the conn strings in a *.dtsconfig file. The reason that I'm trying to use the machine.config is for the simple reason that I'll be able to manage all of the conn strings in one location on each server. (Instead of mutliple dtsconfig files.) Is it posible to utilize the machine.config in SSIS? If so, could someone explain how, or better yet, have an example?

thanks for the help!

View 11 Replies View Related

Storing Connection Strings In Machine.config In SP2?

Mar 8, 2007

Is there now any way to store connection strings for use in SSIS packages in the machine.config with SP2?

View 4 Replies View Related

Dynamic Database Connection In SSIS Without Using A Config File

May 1, 2008

I'm a newbie to SSIS so this question may cause people to point and laugh. I apologise if that's the case.

I have a configuration database that holds connection details to a remote database. I want to use these connection details to dynamically create a new connection to some remote database.

I usually work in with C# where this would be simple but I can't find how to do this using SSIS.

I have found people using configuration files but as I already have my connection data in a table I don't really want to strip it out. (Also, is it a security risk to have database connection strings stored in a config file?)

I have been able to implement a custom script object to build the connection string and assign it to a user variable within the package but can't find any way to then use that variable to connect to the remote database.

Can anyone help?

View 6 Replies View Related

SSIS - Excel Connection Error When Using Config Files

Mar 26, 2008

I have several SSIS packages, some of which retrieve data from excel files - they work fine from th VS designer until I try to store configurations in a SQL database - then I get the following error:


SSIS package "ITAMdiv2.dtsx" starting.

Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.

Error: 0xC0202009 at ITAMdiv2, Connection manager "ExcelDIV2": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.

An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

Error: 0xC020801C at Data Flow Task, Excel Source [84]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "ExcelDIV2" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

Error: 0xC0047017 at Data Flow Task, DTS.Pipeline: component "Excel Source" (84) failed validation and returned error code 0xC020801C.


any ideas?

Thanks in advance@!

Bob

View 1 Replies View Related

Synchronize Connection Strings Dialog Box With XML Config File

Aug 17, 2006

Hello,

This has been happening to me since I started using Configuration files.  I
use one XML config file that stores Machine Specific settings and one
connection string to my Metadata database.  The problem is the database
connection.

When I set the conection in the Configuation file, save, close and reopen
the package, a dialog box opens with the title "Synchronize Connection
Strings".

To reproduce the problem:

1. Ceate New SSIS Project
2. New Data Source Localhost.Adventureworks
3. In Package.dtsx  create an New Connection from Data Source...
4. Choose AdventureWorks
5. Save Package
6. Close Package
7. Open Package

There is no problem at this point.

8. Enable Package Configurations
9. Create a new XML Configuration File
10. Give it a name and a location
11. Click Next
12. Under Connection Managers Click Adventure Work
13. Click Next
14. Give it a Name
15. Click Finish

16. Save
17. Close
18. Open

Uh-Oh!

"Synchronize Connection Strings" Dialog Box
Hare is what it tells me.

Connection
Adventure Works

Data Source
Adventure Works

Old Connection String
Data Source=.;User ID=;Initial Catalog=AdventureWorks;Integration
Security=True;

Old Connection String

Data Source=.;Initial Catalog=AdventureWorks;Integated Security=True

19. Press OK

20. Save Package
21. Close
22. Open

Uh-Oh, still there.

Has anyone else run into this?  If so, how can I get around it?

Thank you for your help.

View 7 Replies View Related

The AcquireConnection Method Call To The Connection Manager &&<Connection Name&&> Failed With Error Code 0xC020200

Feb 14, 2008

Hi All,
I am getting the following error if I am using the package "Transaction Option=Required" while running through Sql Job:
The AcquireConnection method call to the connection manager "<connection name>" failed with error code 0xC0202009.

while I running the SSIS package on BI environment, I am getting the following error:
[Connection manager "<connection name>"] Error: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D00A "Unable to enlist in the transaction.".

I know the alternative solution is to make the "Transaction Option=Supported", but in my case I have run the whole flow in a single transaction. I came to know that this has been fixed in the service pack1(ref. to http://support.microsoft.com/kb/914375). FYI.. some time it was running successful.

I have taken all the necessary step to run the SSIS package in a distributed transaction(like the steps for MSDTC) and also created the package flow in a sequence.

I was going through the link - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=160340&SiteID=1 but all those didn't solve my problem.

If anyone can help me it will be great. or it is a bug in SSIS?

Thanks.
Jena

View 5 Replies View Related

SSPI Handshake Failed With Error Code 0x8009030c While Establishing A Connection With Integrated Security; The Connection Has Be

Mar 7, 2006

Hello, I have a sql 2005 server, and I am a developer, with the database on my own machine. It alwayws works for me but after some minutes the other developer cant work in the application

He got this error

Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 192.168.1.140]

and When I see the log event after that error, it comes with another error.

SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 192.168.1.140]

He has IIS5 and me too.

I created a user on the domain called ASPSYS with password, then in the IIS on anonymous authentication I put that user with that password, and it works, on both machines.



and in the connection string I have.

<add key="sqlconn" value="Data Source=ESTACION15;Initial Catalog=GescomDefinitiva;Integrated Security=SSPI; Trusted_Connection=true"/>

I go to the profiler, and I see that when he browses a page, the database is accesed with user ASPSYS, but when I browse a page, the database is accesed with user SElevalencia.

Thats strange.

The only way that the other developer can work again on the project is to restart the whole machine. He has windows xp profession, I have windows 2000.

If you want me to send logs please tellme



View 20 Replies View Related







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