connection-string

Dynamically change connectionString in web.config

Hello, I have the following in my web.config <connectionStrings> <add name="ActiveDirectoryConnection" connectionString="LDAP://ActiveDirectoryDomain1.com" providerName="System.Web.Security.ActiveDirectoryMembershipProvider"/> </connectionStrings> I need to add a dropdown box to my login page that allows the user to change the con...

Choosing a Connection String based on kind of request

Hi all, I used to have a web service through which a client could perform DB operations and a website could read the DB. Now, due to re-design needs, through the webservice a client can make DB operations. This DB is in workstation A. Through the same webservice, a website retrieves information from DB. This DB is in workstation B. DB...

Setting Connection string in dbml files using Linq to SQL in Visual Studio 2008

I have an application that works with a database "TestDB". At the time I was developing the application I was using linq to sql and adding my data tables by dragging and dropping to the TestDB.dbml file and probably .net automatically sets the connection string to the local sql server on my machine. The application is supposed to launch ...

MS SQL Connection string for default instance like for named instance

In my .NET application I am connecting to Microsoft SQL Server 2005 or 2008 database. User selects instance which the application shows it and then application should do something with this instance. I take instance names from the registry, HKLM\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL. I do not know if user selects de...

Differentiate between client app and browser in ASMX Web Service?

This is a follow-up to http://stackoverflow.com/questions/3444000/choosing-a-connection-string-based-on-kind-of-request for which I got no answer and what I thought worked doesn't. I have a webservice that needs to choose a specific connection string based on the user calling it from a browser or from a client application. I tried: H...

Changing dataset connection string at runtime

I have a c# generated dataset. How can I change the connection string so I can use the dataset with another (identically structured yet differently populated) database? This has to occur at runtime as I do not know the server or database name at compile time. I am using c# 2.0. ...

SQL Express Connection string - Relative to application location

I am using a SQL express databases as part of a unit test project in c#. My databases is located in ./Databases/MyUnitTestDB.mdf I would like to use a relative path or variable in the app.config rather than having my connection string defined as: .. AttachDbFilename=C:\blah\blah\blah\yea\yea\yea\MyApplication\Databases\MyUnitTestDB.md...

How do I deploy an access backend?

Hello; I have created a windows forms application using Visual C# and ms acces 2007. The connection string to the database from the application looks like this. <connectionStrings> <add name="CRMS.Properties.Settings.CRMSConnectionString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\CRMS.accdb" providerN...

Java newbie needs help with database connection

I'm new to Java but even newer to java database connections. I've managed to create a database connection and query a table when I put it in the Main class. Now that I've moved it into a new class called Connection I've getting errors: package lokate; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Stateme...

How do I manage NHibernate and Asp.NET MVC ConnectionStrings for seperate projects

I would like to get opinion on the best way to manage the following please. I have an MVC application project, as well as a DomainModel project. The NHibernate mappings and hibernate.cfg.xml are in the DomainModel project which is referenced in the MVC application. This would normally work fine as all my dataaccess would go through the N...

Connecting to a dBase file on a remote server

Hello, I have an asp.net website that needs to connect to a dBase file on a remote server. The remote server has a ODBC System DSN connection configured but I have no idea how to connect to it. ...

asp.net oracle connection with tns info

now I am connecting my oracle db with connection string in webconfig. thas is But I wanna connect oracle database with tns like that tns: TDDB.xe=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=20.100.173.31)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=tddb))) user/pass = hr/hr if this is posssible , ...

how can i dynamically change the connection string

I am using vb.net and SQL server 2005 I have a project with database classes which are generated from database objects. That is I add a dataset to the project and drag and drop a database object onto it. The problem with this is that I have to give a connectionstring which is stored in the code. This is ok while developing the applicati...

Testing Repositories in Entity Framework

Hi I'm new to EF but am trying to go by the book and create tests for my repositories. The tests fails here. desiner.cs base(global::System.Configuration.ConfigurationManager.ConnectionStrings["pij_localConnectionString"].ConnectionString, mappingSource) I presume I need to move the connection strings out of the webconfig. What is t...

Web.Config file corrupting on publish

So I've just started up my most recent website: http://EpicClanWars.com and it would seem that every 5th or 6th time I publish my project out of VS 2005 the Web.Config file corrupts and loses its connection string to the database and a nasty exception gets thrown stating that the web.config file does not contain the connection string th...

Storing Connection String on Database

I couldn't find a question that would fit this purpose, so I'm asking it. We have deployed an ASP.NET website that has two Connection Strings, one of them can be configured by the user, in runtime. The problem is, since I'm using .NET Framework to do this, it creates a temporary file by the time the web.config is altered, which forces m...

ASP.NET: "Could not find installable ISAM" exception when trying to read dBASE IV file.

I need to open and read a Dbase file in my ASP.NET application. When I try to open the connection, I am getting the exception "Could not find installable ISAM." I have tried the solutions in the top answer in this question, but they did not work for me. The filepath of the data file is C:\dev\DATA.DBF. Here is the code I am using to try...

ADO.NET Connection String

I have a SQL Server 2008 database that uses a default schema called "Arxame". How do I specify or change the default schema from "dbo" to "Arxame" in my connection string? I'm using C# and ADO.NET. ...

c# DB connection string through VPN

I am trying to connect to a database on another network through a vpn. How do I set up the connection string? There is a network password to get on the network and then a database password to connect. Is there a way to set this up? <connectionStrings> <add name="remoteDB" connectionString="eng=INV;Links=tcpip(Host=xxx.xxx.xx.xx,xxxx)...

problem connecting to access database in asp.net 2.0

hi im trying to get a dataset from an access database im using this connection string: <connectionStrings> <add name="SiteConnString" connectionString="Data Source=c:\inetpub\vhosts\db\mainDB.mdb" providerName="Microsoft.Jet.OLEDB.4.0" /> </connectionStrings> and this is my call to SqlHelper: myDataSet = SqlHelper.Exec...