connection-string

Build SQL Connection string with integrated security for use over VPN?

北慕城南 提交于 2019-12-01 22:19:52
I have Winforms application that connects to a SQL database. We are changing the connection strings so that they will now use integrated security (Windows Authentication) instead of SQL authentication. We have a few cases where people use the application over a VPN on their home computer. Connecting to the database with SQL authentication isn't a problem over the VPN. I was wondering if there was a way in .NET to build a connection string with user's Windows Credentials specified to connect to the SQL database. I've seen this question. But the application I'm working with is a Click-Once

VARCHAR size limit in Excel spreadsheets

房东的猫 提交于 2019-12-01 21:54:46
I'm trying to read some data from an SQL Server 2008 database into an Excel 2007 spreadsheet with C#, using this connection string: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=foo.xlsx;Extended Properties='Excel 12.0 XML;HDR=YES' One of the columns in the database is a VARCHAR(1000). When I try recreating the schema in the spreadsheet, it seems like Excel's VARCHAR only supports up to 255. This page suggests that the "Total number of characters that a cell can contain" is around 32K, so in principle, it should be possible to get a longer string in. Is there a simple way to work around the

How can i change the default database for simple membership tables

坚强是说给别人听的谎言 提交于 2019-12-01 20:30:00
I would like to ask this quick question about the default simple membership database that comes with asp.net mvc 4.5 internet application , my question is about where does it create its tables when I first create new user does it create its table in the default connection string (LocalDB) ? and what if I changed the default connection string to use a custom MS SQL Express database will that get reflected and those tables will be created in my new database ? i noticed this code in the default account model and in its DbContext class it refers to default connection this was the code there :

How to get server name through code if SQL Server (Standard Edition) is installed

孤人 提交于 2019-12-01 18:22:27
How to get server name through code if SQL Server (Standard Edition) is installed. We pass the server name while creating a connection string to connect SQL Server. Can we retrieve this value through code? string sqlConnectionString = string.Format( "user id={0};password={1};server={2};Trusted_Connection=no;database=TestDB; connection timeout={3}", dirDBinfo.UserName, dirDBinfo.Password, "ServerName", dirDBinfo.TimeOut); I'm not sure I understand what you want. If you already have a connection string, and you are trying to extract the server name from it for use elsewhere, you can reverse

Azure connection string exception “network-related orinstance-specific error occurred”

牧云@^-^@ 提交于 2019-12-01 18:12:10
When attempting to connect to SQL Azure with the following connection string Server=tcp:SERVER.database.windows.net,1433;Database=DBNAME;User ID=USER@SERVER;Password=PASSWORD;Trusted_Connection=False;Encrypt=True from a locally running ASP.NET MVC application I receive this exception: {"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.)

How to get server name through code if SQL Server (Standard Edition) is installed

社会主义新天地 提交于 2019-12-01 18:03:32
问题 How to get server name through code if SQL Server (Standard Edition) is installed. We pass the server name while creating a connection string to connect SQL Server. Can we retrieve this value through code? string sqlConnectionString = string.Format( "user id={0};password={1};server={2};Trusted_Connection=no;database=TestDB; connection timeout={3}", dirDBinfo.UserName, dirDBinfo.Password, "ServerName", dirDBinfo.TimeOut); 回答1: I'm not sure I understand what you want. If you already have a

Oracle: what is the “instantclient” connection string format?

别说谁变了你拦得住时间么 提交于 2019-12-01 17:55:03
and how does it differ from the regular connection string? Connecting with the instant client is no different than with the full stack client - all connect string formats are the same. If you installed the instant client in a non-standard location on the filesystem or are having problems connecting to the database listener, be sure that your TNS_ADMIN environment points to the directory that contains your tnsnames.ora and sqlnet.ora files, Here is a comprehensive list of connection strings for Oracle ( http://www.connectionstrings.com/oracle ) The format is: name/pass@//host:1521/instance

Autogenerated default connection string vs. manually added one

无人久伴 提交于 2019-12-01 17:46:23
Let's say I have got simple WPF application using Entity Framework Code First to create database, connect to it and display some data. From start I do not want to worry about connection strings so after adding entityframework reference via Nuget I'll get auto generated app.config looking like this: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,

Entity Framework: Illegal characters in path. (Connection String) (MVC3)

拟墨画扇 提交于 2019-12-01 17:44:57
问题 I just can't get this thing solved: I'm trying to use the Entity Framework in my MVC3 project. But each time I call Entities context = new Entities(); I receive this error: Illegal characters in path. I do know this has something to do with my connectionstring, which is as follows: metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=databasename;Persist

Azure connection string exception “network-related orinstance-specific error occurred”

↘锁芯ラ 提交于 2019-12-01 17:31:25
问题 When attempting to connect to SQL Azure with the following connection string Server=tcp:SERVER.database.windows.net,1433;Database=DBNAME;User ID=USER@SERVER;Password=PASSWORD;Trusted_Connection=False;Encrypt=True from a locally running ASP.NET MVC application I receive this exception: {"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server