connection-string

c# 2008 SQL Server Express Connection String

Hi, I have a 2008 SQL Server Express installed on one of my machines and I'm attempting to establish a remote connection... when I use the MS SQL Server Management Studio I can log into the database without any problems at all (with the same credentials), but when I try to create a connection string in my C# application I get an excepti...

How to fix "The ConnectionString property has not been initialized"

When I start my application I get: The ConnectionString property has not been initialized. Web.config: <connectionStrings> <add name="MyDB" connectionString="Data Source=localhost\sqlexpress;Initial Catalog=mydatabase;User Id=myuser;Password=mypassword;" /> </connectionStrings> The stack being: System.Data.SqlClient.S...

DSN to connectionstring?

We've got an ASP.NET website that uses a database that we want to be able to use a connectionstring to get to. We've successfully set up a DSN for connecting to this DB, but I can't seem to discover the correct magic to go with a connectionstring. Is there a straightforward way to translate the values from the DSN into a connectionstri...

How can I connect to Sql Server 2008 remotely using an IP Address?

When I publish my project clients will need to be able to setup the initial configuration, and part of that is the Sql Database Connection. I have an instance of Sql Server 2008 running on my system (MSSQLSERVER2008) as well as SQLEXPRESS2005. I am trying to use the following connection string locally just to see if this works, and I can...

Access Database, Connection string jiggery pokerery!

Hi, I am trying, from my c# codefile to access an Access Database. If I use the: SqlConnection connection = new SqlConnection(connectionString) with the connection string being: connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\testing_dev\sm_development\App_Data\SMWeb.mdb" I get an error when I try and create a...

connection string for remote database server

Hi guys, I have 2 servers setup at the moment. One is a web server running Win Server 08 and the other is a database server running SQL Server 08 on Win Server 08. Currently I have my site setup so that it can read/write to the database by using a connection string I created with the database name, server ip, db user and db pwd. The db...

ASP.NET: How to create a connection from a web.config ConnectionString?

How do you construct a DbConnection based on a provider name? Sample provider names System.Data.SqlClient System.Data.OleDb System.Data.Odbc FirebirdSql.Data.FirebirdClient i have connection strings stored in my IIS server's web.config file: <connectionStrings> <add name="development" connectionString="Provider = IBMDA400...

Winforms - Replace a ConnectionString at runtime

Hi, I'd like to allow my user's to switch between different databases on the login page at runtime. I've currently got the ConnectionString stored in my App Settings file and all the dataset's refer to this setting. I have tried modifying this setting at runtime, but this seems impossible. How is the best way to do this? Thanks, ...

Do connection string DNS lookups get cached?

Suppose the following: I have a database set up on database.mywebsite.com, which resolves to IP 111.111.1.1, running from a local DNS server on our network. I have countless ASP, ASP.NET and WinForms applications that use a connection string utilising database.mywebsite.com as the server name, all running from the internal network. Th...

web.config error

i am trying to deploy my website to my host and get following error message on my web. config file: The configuration section 'connectionStrings' cannot be read because it is missing a section declaration at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse respon...

Protecting connection string from Man in the middle

In my winforms application i am hashing the connection string in local level. But here a couple of questions. After my app decrypts the connection string, the connection string info is sent in clear text? And since my app is installed locally the man in the middle could be ANY user? How can i protect the connection string, becides th...

Split a string by semicolons while accounting for escaped characters

Really simple problem: I want to split a connection string into its keyword / value pairs, so for example the following connection string: Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=vm-jp-dev2;Data Source=scsql\sql2005;Auto Translate=False Would become: Provider=SQLOLEDB.1 Integrated Se...

Is there a way to force a jdbc connection to use TCP?

In a normal SQL Server 2005 connection string, it's possible to specify the desired protocol in the following format: Data Source=tcp:myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI; Is there a way to do something similar in a JDBC connection string to SQL Server? Edit: My JDBC Connection String looks like this...

Is there some Gui component I can use to allow users to create connection strings?

I have an client app which will use a connection string to get access to some data. I need the administrators to be able to define the connection string that the clients will use. I would like to give them a wizard similar to the one that is used to define a new ODBC data source, but don't want to write all of this functionality myself...

LinqToSql dbml dynamically switch connectionstring

Greetings All, We have two databases, DEV and STAGING. They are for the most part identical. I have an app settings tag in the Web.Config call it "mode", and two connectionstring entries. If mode=DEV I want to use ConnectionString 1 otherwise use ConnectionString 2. This works fine in some parts of the app, but the dbml doesn't seem to ...

Reporting Services, how to use a connection string from a query result

A report needs to be run on multiple sites, each with its own connection string. These site names and connection strings are stored centrally. I want to make a report that Accepts the site name as a parameter Queries for the sites connection string Uses the sites connection string to get the report's data I've tried using two data ...

ConnectionString property has not been initialized.

I've looked at a lot of posts on different forums where others have received the same error. Most say they were not referencing the connectionstring from the web.config file correctly, or they were trying to open the connection before setting the connectionstring. Well, if that were the case for me, then how does it work on two different...

Confusion about where to store Application Settings in .NET Win apps

I need to know where and how application settings (connections string) could be stored so that they can be changed at run time and saved. I know in VS you can configure settings under Project>Properties and these get stored in the appname.exe.config file under apps install directory.But the "application scope" ones are not read/write at...

What is preferred method for modifying connection string settings in DAL class library when deploying asp.net web app?

I deployed my asp.net web app project that has a reference to my DAL class library. How can I change the connection string in my DAL library once deployed? The DAL code was ignoring my web.config connection string and trying to use the app.config value. I thought I would be able to edit a config file that is associated with the class l...

How to Assign Connection String to ChangePassword control in ASP.Net c#

Hi All, I have distributed data base system and in my project data base connection string is in session object. The problem is how to assign connection string to ChangePassword control on Runtime from session object. Thanks.. ...