connection-string

Understand Sql Server connectionstring for asp.net

Hi, I am trying to understand the differences between the following 2 connectionstrings. one uses servername\instancename and the other one uses the server ip address. Can I specify port number for "serverName\instanceName". I know you can specify port number for ip address, something like '10.0.0.1,xxx'. thanks, Server=myServerName...

Change connection on the fly

Hello, I have a SQL server with 50 databases. Each one has the exact same schema. I used the awesome Subsonic 2.2 create the DAL based on one of them. I need to loop though a list of database names and connect to each one and perform an update one at a time. If there a way to alter how subsonic uses the connection string. I believe I w...

Winforms connection strings from App.config

I have a Winforms app that I am developing in C# that will serve as a frontend for a SQL Server 2005 database. I rolled the executable out to a test machine and ran it. It worked perfectly fine on the test machine up until the last round of changes that I made. However, now on the test machine, it throws the following exception immediate...

LinqToSql ConnectionString won't set to "(None)"

Normally when you click in any whitespace in a LinqToSql dbml file, you can then go over to the properties window and set the Connection to (None). This is essential to me because it allows me to put the connection string in the web.config. The "(none)" option does not always show for me, especially after i make updates to the generated...

Multiple ports listed in SQL Server connection string

I have a legacy VB6 app where the servername, databasename, username, etc are defined in an INI file, but the port number for the connection string (the default 1433) is hard coded in the app. It's being moved to a new sql server back end that runs off a different port number. I'm trying to avoid having to alter and recompile the appli...

SQL Server Express 2008 using (local) in connection string

Is it possible to connect to a SQL Server Express 2008 database in ASP.NET with a server name of (local) like "server=(local);integrated security=SSPI;database=DBNAME"? I'm working with another developer on a project and it's getting annoying having to have 2 different version of web.config because he is using SQL Server 2008 and (local...

DSNless connection for Aruna DB?

Right now we are using Fastpath ODBC DSN connection method to access our "ARUNA" Database. Our development platform is C# on the .NET Framework. We are in need of connecting the DB without using DSN. Is it possible to connect Aruna using DSN less method? Update Somewhere I heard about ODBC Bridge softwares, can anybody shed light on...

connection string reading data from excel in asp.net

Hello, I am trying to read data from excel file in asp.net. I have added the connection string to webConfig file: <add name="xls" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HPM_DB.xls;Extended Properties=Excel 8.0"/> But it shows me an errormessage when I run this query: string query = "Select * from [IO_Definiti...

How do I connect to SQL Server with VB?

Hi, I'm trying to connect to a SQL server from VB. The SQL server is across the network uses my windows login for authentication. I can access the server using the following python code: import odbc conn = odbc.odbc('SignInspection') c = conn.cursor() c.execute("SELECT * FROM list_domain") c.fetchone() This code works fine, returning...

trusted SQL Server connection

When I attempt to make a connection from my console app to my sqlExpress. I get the following error: The user is not associated with a trusted SQL Server connection. I have: Switched users Switched passwords Switched Servers Switched Databases I always get the same error. I am using VS 2010 and Sql Server 2005 Here is my current ...

ObjectContext ConnectionString Sqlite

I need to connect to a database in Sqlite so i downloaded and installed System.Data.SQLite and with the designer dragged all my tables. The designer created a .cs file with public class Entities : ObjectContext and 3 constructors: 1st public Entities() : base("name=Entities", "Entities") this one load the connection string from A...

Is there a generic way of dealing with varying connection strings in C#?

I have an application that needs to connect to a SQL database, and execute a SQL Agent Job. The connection string I am trying to access is stored in the registry, which is easily enough pulled out. This appliction is to be run on multiple computers, and I cannot guarantee the format of this connection string being consistent across the...

entity framework client connection details versus connection details in EF library?

Hi, I have an EF project which has embedded connection details. Then when I use this project from a client library I get told to copy the config file across, which includes the connection details. What are the rules re which connection string would be used here? i.e. does the database connection string in the client project override ...

how can I swap Entity Framework connection strings easily when I test on different servers (i.e. different databases)

how can I swap Entity Framework connection strings easily when I test on different servers (i.e. different databases) - at the moment it is a bit tedious going into the design parameters and trying to swap back and forth each time I change. ...

how to use Settings.settings for entity framework connection strings?

I'd like to store the Entity model connection string in the app.config using the same approach used by old Typed DataSet. Both use the same section: <connectionStrings>. Entity saves the connection as: <add name="MyDB_Entities" connectionString="metadata=res://*/MyDB.csdl|res:......" providerName="System.Data.EntityClient" /> Typed Da...

How can I switch between 2 Connection Strings in my Web.Config (Activate one for DBML)

Hello! I have two connection strings (both in Web.Config: CS_Local and CS_Production) for my DBML (Linq to SQL). In my Global.Asax/Application_Start I run some production preparation methods if the request is non-local (!HttpContext.Current.Request.IsLocal). Within that part, I'd also like to change the current connection string used b...

Read data from uploaded excel

Hello, I need to create an ASP.NET 2.0+ web application that allows the user to upload some excel files; the contents from these files should be saved into some SQL database. The problem is with the connection string one should use in ADO.NET. According to this entry (and few others from SO), one has to specify the physical path to the ...

Is there a simple to know if my connection string is encrypt or not?

I want to know if my connection string is encrypted or not. I don't want to encrypt it again and again. This is only an issue in development stage. Any way to check the status of the connection string in App.config? ...

Problem with connectionstring and entityframework

Hello, I have a database (sql 2008 mdf file), a class library project with an edmx file, created with the wizard. So the connection string is also made by the wizard. This project is on a teamfoundation server. I can use all the wizard made objects when coding. But when i run the program and I try to make an entityContainerName, the ...

Settings designer file complains when protecting configuration for connectionStrings in App.Config in VS 2010

Hi, I am trying to encrypt Configuration Information Using Protected Configuration in Visual Studio 2010. I have the following info speicifed in the App.Config file: <connectionStrings configProtectionProvider="TheProviderName"> <EncryptedData> <CipherData> <CipherValue>VALUE GOES HERE</CipherValue> </CipherData> </Encrypted...