connection-string

LINQPad - Connection String to my Oracle DB

吃可爱长大的小学妹 提交于 2019-12-04 09:44:28
问题 I just started using LINQPad and all works great when connecting to my SQL Server DB, but now I'm trying to set up a second connection to my Oracle DB and I'm getting stuck as to how to do it. I downloaded the IQ driver (v 2.0.8.0 - Latest) and when I go to add a new connection, I select Oracle as my DB Provider and don't know how to do the rest based upon my usual connection string looking as follows: Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = [IP Address])(PORT = [Port]))

Connect to remote MongoDB instance from ASP.NET

隐身守侯 提交于 2019-12-04 09:40:59
I'm having some trouble nutting out why I'm unable to connect to a new database I've created at MongoHQ. I want to include the correct connection string in my Web.config file and have my Mongo object refer to that for the database connection. The connection strings (edited, obviously) are: Public Access mongo flame.mongohq.com:27065/dunedin -u {username} -p {password} AWS Internal Access mongo flame.local.mongohq.com:27065/dunedin -u {username} -p {password} Obviously, I've included my correct username in password in place of the placeholders in the braces. My code is: string connection =

An attempt to attach an auto-named database for file failed in Vb.Net

泪湿孤枕 提交于 2019-12-04 07:00:16
问题 I am Trying to connect database for first time , and I am getting this error : An attempt to attach an auto-named database for file VBTestDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. and getting error on myconnect.Open() Heres my code : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myconnect As New SqlClient.SqlConnection myconnect.ConnectionString =

How to access a connection string from within a library

心已入冬 提交于 2019-12-04 06:58:09
I have a web project (mvc) and data access layer in a separated class library project. I need to access to a connection string in app.config which sits in that library project. ConfigurationManager.ConnectionStrings[0].ConnectionString pulls something strange. I don't have this kind of settings neither in the library's config nor in the web project's config files. the App.config looks like that: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="DALConnectionString" connectionString="User ID=sa;Password=pass;Initial Catalog=db;Data Source=srv\SQL2005;" /> <

Accessing ConfigurationManager.AppSettings value from Spring.NET xml configuration

时光总嘲笑我的痴心妄想 提交于 2019-12-04 06:53:39
I have a requirement that requires me to use Spring.net to get a connectionstring that is stored inside the app.config, and then inject the retrieved connectionstring to a instantiated object. How can I do this using Spring.net's xml configuration? For e.g., instead of my codes doing this: // Spring.net config: <object name="myService" type="com.acme.MyService, com.acme"> <constructor-arg type="System.String" value="myConnectionName"/> </object> // Web.config: <connectionStrings> <add name="myConnectionName" connectionString="DB_connectionstring"/> </connectionStrings> // Codes: public class

Changing connection string dynamically

我的梦境 提交于 2019-12-04 06:48:30
问题 I have a scenario where i am getting dynamically generated databases. I want to create a connection string for each database. So only initial catalog parameter will be changing. Other parameters i ll get it from web config file. It is already having all entries of connection string. I want to change only initial catalog part dynamically based on database created. Please suggest is there any way to easily to do this. 回答1: Use SqlConnectionStringBuilder. Set it up from the config file and

can i connect to a remote SQLCe database?

北城以北 提交于 2019-12-04 06:37:39
问题 We've got an SQL Ce database on a remote machine and we're trying to get a reporting system (using custom LINQ queries) via c# to connect to the database in shared read mode. At this point we're getting an exception "There is a file sharing violation", even when the database has no other conections. Our sql connection string appears thus: using (SqlCeConnection conn = new SqlCeConnection( "Data Source=\\\\telemetry\\C$\\users\\usermetrics.sdf; File Mode=shared read;)) { conn.Open( ); // =>

connection string for a vb.net application to be deployed in random system

夙愿已清 提交于 2019-12-04 05:45:26
问题 I am facing problem in using vb.net with sql server as DB.. Problem is of connection string i.e for 'n' no. Of systems what shall be the connection string? App after geting deployed in other system creates connection path error. what shall be coded so that connection string is defined automatically .? please share any link or explanation for the same 回答1: Below is a VB.Net code snippet to retrieve a connection string from the app.config. The project will need a reference to System

how to solve Keyword not supported: 'data source'

自闭症网瘾萝莉.ら 提交于 2019-12-04 04:56:57
问题 I uploaded my website( that is programmed with asp.net mvc and entity framework 5 ) yesterday and wrote this connection string in the web.config file of the host root ( control panel is plesk onyx) I tried changing it to SqlCLient ,Removing some tags, and so many other things but no change it return error: keyword not supported: 'data source' when I remove data source it return keyword not supported 'initial catalog' and so on thanks for your attention <add name="ShopDBEntities"

MembershipProvider change connection string in code

本秂侑毒 提交于 2019-12-04 04:55:32
I am trying to implement Asp.net Forms Authentication in my site. Usually, you provide the name of your DB connection string in your web.config. However, as our database setup is a little more complicated, I was looking for a way to manually provide the MembershipProvider the connection string in code. Thanks! You don't have to use a connectionStringName for SqlMembershipProvider , instead you can supply the connection string directly. I.e. instead of: <membership defaultProvider="SqlProvider" ...> <providers> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider"