connection-string

Proper way to programmatically set database connection for Crystal Reports

为君一笑 提交于 2021-02-11 14:45:24
问题 I am new to Crystal reports. I have to set the datasource of the report at run time through code. I have a working code but it is very unpredictable and has been giving many problems. I just wanted to know if I am doing something wrong or if there is a better way to do this. Sometimes I feel the report is not even using the connection string rather using the connection that was specified at compile time of the report from the standalone Crystal application. Is this true? Dim connectionInfo As

User Secrets in .NET 4.7 connectionstrings format

拜拜、爱过 提交于 2021-02-11 13:55:48
问题 I have been digging for hours and keep coming up with information about .NET Core, yet hardly anything about .NET 4.7 full framework. I figured out how to add User Secrets to the main project of my Web API solution. I get the basic secrets.xml file where I need to to either store my database username and password or my connection string. Every post I find talks about the changes you need to make to web.config. However nothing shows what to do with my connection string, how to format it, in

Connection String Security C#

自古美人都是妖i 提交于 2021-02-11 06:24:51
问题 i create a c# program that use mysql to verify user login.I googled about connection string security and every thing was about web.config file. Is that necessary to hide connection string in pure c# program?if yes, please give me reference to do that. I encrypt my code, is that enough to protect connection string in my program? private static MySqlConnection myConnection = new MySqlConnection("sample connection string"); tiny edit after solve the problem: I find goof article and project to

Connection String Security C#

人走茶凉 提交于 2021-02-11 06:23:22
问题 i create a c# program that use mysql to verify user login.I googled about connection string security and every thing was about web.config file. Is that necessary to hide connection string in pure c# program?if yes, please give me reference to do that. I encrypt my code, is that enough to protect connection string in my program? private static MySqlConnection myConnection = new MySqlConnection("sample connection string"); tiny edit after solve the problem: I find goof article and project to

How to create a valid connection string for Entity Framework - The underlying provider failed on Open?

别来无恙 提交于 2021-02-10 05:22:16
问题 Given the following connection string: <add name="PrimaryDBConnectionString" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string="Data Source=10.1.1.101;Initial Catalog=primary;Persist Security Info=True;User ID=myuserid;Password=mypassword;MultipleActiveResultSets=True;Application Name=EntityFramework"" /> I attempt to open a connection in my DAL with the following: using (PrimaryDBContext ctx = new PrimaryDBContext(ConfigurationManager

how to make a connection string for oracle that includes hostname, instance name, user id, password using system.data.oracleclient?

僤鯓⒐⒋嵵緔 提交于 2021-02-08 11:23:19
问题 I have made a connection string in oracle like: Data Source=hostname;Initial Catalog=IMPORT_UTILITY;User ID=abc;password=123 I want to make the same for oracle. I am using ODBC . can anyone tell me what will be the connection string for oracle that will be equivalent to above sql connection string using odbc? 回答1: For Oracle 12c R2 and the Instant Client ODBC Driver (version 12.2.0.1.0) the following connection string should work without having to create a DSN and/or a tnsnames.ora file:

SQL Server - Invalid Argument Supplied

岁酱吖の 提交于 2021-02-08 08:34:56
问题 So we have SQL Server 2008 R2 Express running on a local server, and a bunch of machines on the same LAN use a program I wrote in C# to access said server. All the machines in the building except one can connect quite happily. Connection string is: Data Source=[IP address here],53535\SQLEXPRESS;Initial Catalog=EMS_Main;;User ID=EMSUser;Password=[password here]; Exact error message is: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The

ASP.NET MVC - Switching from SQL Server Express to Compact Edition - Connection Issue

China☆狼群 提交于 2021-02-08 05:24:14
问题 I have a ASP.NET MVC 4 project - CodeFirst with Entity Framework - that was connected to a SQL Server Express database generated by EF and it was working just fine. However, I am trying to deploy to AppHarbor and having some issues with the version of SQL running there connecting with my app. So, I noticed that they have an example project that is utilizing SQL Server Compact Edition 4. Here is the web.config file for that project: https://github.com/friism/CodeFirstMigrations/blob/master/Web

Where to store Connection String

我怕爱的太早我们不能终老 提交于 2021-02-07 14:39:27
问题 I am creating a Class Library which contains all the custom classes I regularly use in the applications I develop. This library is compiled and added as a Reference in each of my applications, enabling me to call on the custom classes contained within the library. The custom classes in my library include multiple layers of inheritance, but all ultimately have their origins in a base class I call 'Alpha'. In that class I also hold my connection string so that it is inherited by all other

How to Change ConnectionStrings at Runtime for a Web API

試著忘記壹切 提交于 2021-02-07 12:27:34
问题 I hope this is a simple question: How can you change 2 connection strings at runtime in the Global.asax under Application_Start() Web.config <connectionStrings> <add connectionString="DB1" value=""/> <add connectionString="DB2" value=""/> </connectionStrings> Global.asax protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable