connection-string

Excel macro to change external data query connections - e.g. point from one database to another

☆樱花仙子☆ 提交于 2019-11-26 17:07:54
问题 I'm looking for a macro/vbs to update all the external data query connections to point at a different server or database. This is a pain to do manually and in versions of Excel before 2007 it sometimes seems impossible to do manually. Anyone have a sample? I see there are different types of connections 'OLEDB' and 'ODBC', so I guess I need to deal with different formats of connection strings? 回答1: I ended up writing the following, which prompts for the connection details, creates a connection

error: the details of the application error from being viewed remotely

浪子不回头ぞ 提交于 2019-11-26 17:01:14
问题 I have 2 login pages: Login.aspx-for customer login and xlogin.aspx for admin login i just uploaded my project to the server and all application pages works great but when i log in the admin xlogin.aspx i'm being forwarded to the admin.aspx page - but i get this error: Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed

How to securely store a connection string in a WinForms application?

北城余情 提交于 2019-11-26 16:56:44
问题 I need to know what is the common way to store a SQL server connection string for a WinForms application in VB.NET. I have searched the net and I found answers to each of the following questions: How do I read app.config values How to do it in ASP.NET Reference: this SO question. How do I store a connection string (unencrypted thus unsafe) I would like a full answer on how to store a connection string in VB.NET in app.config (or settings.settings if it's better) securely. Is app.config the

Connection string - Keyword not supported: 'initial catalog'

。_饼干妹妹 提交于 2019-11-26 16:44:23
问题 I am using Webmatrix.data's Database entity to create a database connection, however it doesnt like my connection string. I am running it from MVC ASP.net. Ive tried changing it to server / database, but still errors the same. Where am I going wrong? using (var db = Database.OpenConnectionString(@"Data Source=MY-HP\Serv;Initial Catalog=MyDBSQL;User ID=sa;Password=password")) { var items = db.Query("SELECT * FROM TaskPriority"); } Exception Details: System.ArgumentException: Keyword not

Linq to Sql - Set connection string dynamically based on environment variable

时光总嘲笑我的痴心妄想 提交于 2019-11-26 16:29:54
问题 I need to set my connection string for Linq to Sql based on an environment variable. I have a function which will return the connection string from the web.config based on the environment variable, but how do I get Linq to always use this "dynamically created" connection string (preferably without having to specify it every time)? I know I can specify the connection string using the constructor, but how does that work when using the datacontext in a LinqDataSource? 回答1: Use:

Create a jTDS connection string

时光总嘲笑我的痴心妄想 提交于 2019-11-26 15:52:17
my sql server instance name is MYPC\SQLEXPRESS and I'm trying to create a jTDS connection string to connect to the database 'Blog'. Can anyone please help me accomplish that? I'm trying to do like this: DriverManager.getConnection("jdbc:jtds:sqlserver://127.0.0.1:1433/Blog", "user", "password"); and I get this: java.sql.SQLException: Network error IOException: Connection refused: connect at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:395) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver

What is the connection string for localdb for version 11

一笑奈何 提交于 2019-11-26 15:21:22
I'm trying to do the Code First Walkthrough of the entity framework ( http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-code-first-walkthrough.aspx ). I have the latest SQL Server Express and when I check my versions available via command line ( sqllocaldb info ): I see localdbApp1 and v11.0. When I try to run the walkthrough with a few minor tweaks, I get a can't connect error. My app.config looks like this: <parameter value="Server=(LocalDB)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" /> I wrote a simple connection test like below and the code returns the same SQL

Error: “Could Not Find Installable ISAM”

 ̄綄美尐妖づ 提交于 2019-11-26 14:40:25
I've written some VBA code in an Excel workbook to retrieve data from an Access database in the same directory on a desktop. It works fine on my machine and several other machines running Windows XP, but when we tested this on a Vista machine, we encountered the following error: Could not find installable ISAM I've done a bunch of searching online but can't seem to find a concrete answer. The connection string seems to be fine, and, as I mentioned, it works on several machines. Does anyone have any idea what could be causing this? My connection string is as follows: Provider=Microsoft.Jet

How to securely store Connection String details in VBA

大兔子大兔子 提交于 2019-11-26 14:35:56
I have an Excel Template that has hardcoded Ms Access MDB path in the VBA code used to connect to the Access tables and save, retrieve data. I migrated the MS Access Database over to SQL Server with Integrated Authentication for the Excel Template Users. My question is, What is the Recommend Way / Best Practice for storing the SQL Server DB connection string and retreiving it in Excel 2007 VBA to save and retrieve data? In the past, I have done the following. Use a Registry Key setting that has the Connection String. Then in the VBA, write a function that reads the registry key and returns the

Read connection string from web.config

删除回忆录丶 提交于 2019-11-26 14:15:38
How can I read a connection string from a web.config file into a public class contained within a class library? I've tried: WebConfigurationManager ConfigurationManager But these classes are not recognized within my class library. peteisace Add System.Configuration as a reference. For some bizarre reason it's not included by default. Muhammad Akhtar You need to add a reference to System.Configuration and then use: System.Configuration.ConfigurationManager. ConnectionStrings["connectionStringName"].ConnectionString; MDM C# // Add a using directive at the top of your code file using System