connection-string

Attach SQL Server mdb file at runtime

I want to attach SQL Server 2005 database at runtime. Can this be achieved without using local instance of SQL Server i.e. even without SQL Server Express? Currently I'am using following connection string is there any other workaround. Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connectio...

Sharing connectionstrings between 2 .NET applications

Suppose I have an ASP.NET website running with its corresponding web.config file, which contains a bunch of connectionstrings for database access. I also have a little helper console program (deployed to the same folder as the web app) that does maintenance tasks and other stuff. This helper programs shares a bunch of dll's with the web...

Different Connection Strings with Entity Framework based on Context

I have a web forms application that uses entity framework, the application is deployed on a development box, my local machine and a production box. Each of these have different connection strings. What is the best way of handling this. I use TFS Build Server to deploy to development and take the result of that build zip it and copy it t...

MS SQL update to Integrated Security

Hi: For debugging purpose, I backedup one of QA database and restored to local machine. Since it is in my local machine, I just want to connect to it using Integrated Security=True in my asp.net application. But I am getting following error: Cannot open database "db1" requested by the login. The login failed. Login failed for us...

Driver Connetion String

I am new to JSP and I am trying to make a connection to a mysql database. I am using Connect/j driver but I cant find the connection string for my Class.forName() method. Please give me suggestions ...

In-Memory SQL-CE

Is there a way to connect to a SQL-CE database as a stream? Specifically, our ASP.Net application builds small SDF at runtime for off-line needs. When the user is done with his off-line duties, he uploads the SDF and the application imports the new and updated data. No problems there. Currently, we're saving the uploaded SDF to the w...

Configuring Remote Database Connection Strings within SQL CLR Assemblies

I'm writing a SQL CLR assembly that will be deployed to a third-party database server, but which needs to execute stored procedures residing in my database server. All the pieces are in place, but I don't know how to make the connection string configurable. Articles such as this: http://msdn.microsoft.com/en-us/library/ms345135%28SQL.90%...

Conditional ConnectionString based on which folder the app is published to

I'm entering a parallel test and dev stage where I need to use one db for test and a different one for dev. How can I have the app choose which connection string to implement based on which physical folder it (the app) sits in? I know there are SVN strategies to consider but this is small-scale enough to avoid 2 sperate code-bases. Woul...

How can I have my C# application use a single FILE database?

Right now I have my program running on my SQLExpress database. But what I'd really like is for my program to run on any machine as long as A DATABASE FILE is in the same folder. How can I accomplish this? Firs things's first: How would my connection string be if I were connecting to a FILE DATABASE? Second: How do I create a single fil...

Is it possible to store database connection string information in Active Directory?

Let's say you have many applications in your environment all of which store their connection strings to SQL Server in a web config. Is it possible to have the application retrieve those connection strings from Active Directory? We're moving some database servers around and would like a way to have them read from a central location. Acti...

Setting up BugTracker.NET complete noob

This is my first ASP.NET project and I'm stuck right away. I'm setting up a bugtracker on a remote webhotel but I can't get the connectionstrings to work. If we say that my host is called hosting.org and my website would be www.trallala.com what do I have to change in this script? <configSections> </configSections> <system.web> <...

Multiple SQL Server connection strings in app.config file

Hi guys, I'm interested in displaying in a Windows Forms app a list of N radio buttons for the user to choose a target database server. I would like to add the SQL Server connection strings in the app.config file, so they are read by the app at runtime and rendered in the windows form as radio buttons. At first I thought of using a de...

Difference between these connection strings?

Can anybody tell me the effective difference between the following connection strings: <add key="ConnectionString" value="server=tcp:192.168.0.12\Sqlserver2005;database=;user id=sa;password=;"> <add key="ConnectionString" value="server=192.168.0.12\Sqlserver2005;database=;user id=sa;password=;Network Library=DBMSSOCN;"> I believe b...

DB connection failed while testing

Hi, I have an asp.net mvc application, which uses the default user database. It all works pretty well, but I would like to create some tests for it. I Have a test project, I immediately stumble upon an exception The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provide...

My.Settings.MyConnectionString works but app.config dont?

I'm not a WinForms developer, but have been doing ASP.NET for quite some time. I have to write something in VB.NET that just pushes some simple data to a database. So I created the VB.NET WinForms app (Visual Studio 2005). When I run the app it works fine for using: Dim conMyData As SqlConnection Dim cmdInsert As SqlCommand ...

Intermittent Oledb connection error "Cannot open database ''."

We are occasionally seeing this error: Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt. This is a Winforms .NET 2.0 product on a Jet/Access DB using Oledb connections. This error occurs only intermittently. Make the same request a couple of minutes before/after ...

How to Read DB Connection String from System Registry?

We are using ASP.NET 3.5 and C# 3.0. According to the client's requirement, the database connection string need to be stored in system registry.During the connection establishment,we have to read the connection string from System Registry. How can i store connection string in System Registry? Using C# how can i programmatically read m...

Change Web.config connectionStrings without resetting sessions

How can <connectionStrings> in Web.config be changed without resetting sessions of logged in users? I'd like to keep using <connectionStrings> instead of creating a custom section because I use LINQ and I don't want to have to hack my DBML. I know that session resets can be avoided using custom sections placed in a separate file with r...

Is there a standard dialog for constructing an ADO.Net connection string (that is redistributable)?

I want to use a standard dialog to solicit user input of an ADO.net connection string. It is trivial to do for the oledb connection string as described here: MSDN Article on MSDASC.DataLinks().Prompt I've also found examples that use Microsoft.Data.ConnectionUI.dll and MicrosoftData.ConnectionUI.Dialog.dll from VS (HOWTO: Using the Cho...

Excel VBA - connect to sql with a trusted connection (no uid/pwd)

Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/password in my code. ...