connection-string

SQL reading the connection string

时光总嘲笑我的痴心妄想 提交于 2019-12-11 09:14:52
问题 is it possible to read the connection string from a txt file, by using the direct path of the said .txt file witch containts the connection string. The code is the following, i have this line wich i want to read the .txt file: SqlConnection conn = @"Data Source='C:\Users\Administrator\Desktop\connstring.txt'"; Instide the said txt file is the real connection string wich is this: @"Data Source=.\wintouch;Initial Catalog=bbl;User ID=sa;Password=Pa$$w0rd"; I know this might not be very safe but

Deploy a LINQ to SQL Library using different SQL users

人盡茶涼 提交于 2019-12-11 07:47:35
问题 Thanks to this website I succeed to use a connectionString localized inside a web.config instead of the one provided in the app.config of the library. But my production and my test SQL Server do not have the same SQL user name. Table(Name="SqlUserName.tableName")] public partial class tableName : INotifyPropertyChanging, INotifyPropertyChanged { ... } When I remove by hand the user name before the table name, it's working. But I still have to problems: Is it good to do that? Maybe there is a

C# Encode connection string from win1251 to utf8 and back

孤街浪徒 提交于 2019-12-11 07:31:33
问题 I'm trying to work around the problem with connection string encoding in Firebird .net provider ver >= 5.6.0.0 (current is 5.8.0.0). The full description of the problem (if you are interested in) is here, but I think I could explain it briefly. So let's start! I have a system default encoding win1251 and a connection string that contains a param calls " DbPath " with value "F:\\Рабочая\\БД\\2.14.1\\January_2017\\MYDB.IB" When I pass this connection string to firebird .net provider it takes

ADO.NET Connection String

让人想犯罪 __ 提交于 2019-12-11 07:01:30
问题 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. 回答1: You can't do that. You have to set the schema "Arxame" to the user you have specified on your connection string. You can do this using the SQL Server Management tool If you need to change the default schema for an existing user you can do it like this B. Changing the default schema of a user

MS Access - prevent SQL injection in connection string

一曲冷凌霜 提交于 2019-12-11 06:45:48
问题 I have an Access database that must connect to Oracle programmatically to create a linked table. The connection string is of the form: ODBC;Driver={Microsoft ODBC for Oracle};Pwd=<Password>;UID=<User>;Server=<Server> Currently the login info is hardcoded. I now have to have the tool connect to different databases. I was going to simply let the user enter the <User> , <Password> , and <Server> and then just concatenate it all together into a single connection string. I'm pretty sure this is

ASP.NET user database without web.config connection strings

爷,独闯天下 提交于 2019-12-11 06:27:52
问题 I'm wondering whether it's possible to use built in ASP.NET application services (aspnet_user, aspnet_role etc table) without specifying a connection string in a web.config. At the moment I store connection strings externally, but I keep finding hard-coded connection strings all over the web.config xml, various providers etc. It's driving me crazy. Thank you 回答1: You can write your own provider via overriding already existed, built-in class so it will read it's connection string from

(JDBC) SQL Server connection string: login failed for user ' '

给你一囗甜甜゛ 提交于 2019-12-11 05:58:50
问题 jdbc:sqlserver://localhost:1433;Data Source=(local); Initial Catalog=MarketDataDB; User Id=andrew; Password=mypassword; Above is the connection string I am using to connect to a SQL Server 2008 R2 Express database using JDBC, but this error is produced: Login failed for user ' ' Any ideas? I can successfully connect to the database from within SQL Server Management Studio using the specified username and password. I am using SQL Server authentication 回答1: jdbc:sqlserver://localhost\

Can Azure Functions written in Node.js access Connection Strings?

妖精的绣舞 提交于 2019-12-11 05:41:55
问题 The App Settings for an Azure Function App contain values for database connection strings that can be set in the portal. In C# they can be accessed using ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString For an Azure Function written in JavaScript, is there an equivalent construction that has access to the connection strings? I understand that they can be stored in the application settings, but since there is a section on the portal devoted to connection strings, I

ADODB.Connection (0x800A0E78)

天涯浪子 提交于 2019-12-11 05:20:00
问题 Original connectionstring whitch working on MSSQL 2000: Provider=SQLOLEDB.1; Persist Security Info=True; User ID=XXXXXXXX; Initial Catalog=IntranetApps; Data Source=MS; Use Procedure for Prepare=1; Auto Translate=True; Packet Size=4096; Workstation ID=datawriter; Password=XXXXXXXX'; New connectionstring which not working on MSSQL 2008: Provider=SQLNCLI10;Server=PR-NB-CIS011\SQLEXPRESS;Database=IntranetApps;Uid=XXXXXXXX;Pwd=XXXXXXXX; I tryed change provider to SQLNCLI10.1, without provider, ..

.Net Standard 2.0 ConfigurationManager Doesn't Read Connection Strings

笑着哭i 提交于 2019-12-11 05:06:55
问题 I have a .Net Standard 2.0 Library. I've references System.Configuration.ConfigurationManager via NuGet and I've added an App.config file with two connection strings. When I break on the following line, I notice that ConnectionStrings only contains a single connection string which is neither of the connection strings I have in my App.Config (shown below). var foo = ConfigurationManager.ConnectionStrings["cs1"].ConnectionString; The single connection string which does appear in