connection-string

ASP.NET beginner question: How to get rid of this error?

巧了我就是萌 提交于 2019-12-24 08:59:00
问题 I am trying to create a simple login page in ASP.NET C# but am getting some error. I googled about the error, and tried all the solutions but to no avail. What am I doing wrong? The error is: "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: SQL Network Interfaces, error: 26 -

ODBC xlsx driver connectionstring without header

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 08:56:06
问题 I am connecting to xlsx files via ODBC with following command: "DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb);HDR=YES;IMEX=1;READONLY=TRUE;DBQ=C:\Temp\test.xlsx" It works fine but I am always missing one line when there is no header in the file. Obviously it's because of the parameter "HDR=YES" but I cant figure out how to disable the header line. I have tried "HDR=NO" and leaving this parameter out but no effect. I can access to the file but I always lose the first line. Can

Day(s) of week selection from QT checkbox to Postgresql

独自空忆成欢 提交于 2019-12-24 07:59:56
问题 I have a group of checkboxes representing the days of a week in my Qt application GUI and I select one or many days, and depending on which boxes are checked, pass a query string to PostgreSQL in order to display certain data on those days -e.g. if I checked monday and wednesday, extract (dow from timestamp) = 1 or extract(dow from timestamp) = 3 should be added to my query. I have just typed a crude solution -though haven't tested yet as I write this-, but I was wondering if there is a

How to correctly move location of .mdf file and change Connection String's DataDirectory accordingly

百般思念 提交于 2019-12-24 07:38:43
问题 Currently my SQL database is on C:\Users\Slaven\KasaMP.mdf I want to move it into my projects directory [maybe "database" folder(?)] and make correct changes on my connectionstring. My goal is to be able to open this project with .mdf file attached on any computer . Current ConnectionString I use is EntityFramework generated and I am not sure what is the approach to make this CS point to different location. ConnectionString: <connectionStrings> <add name="KasaMPEntities" connectionString=

How to connect to Hadoop Hive through python via pyhs2?

99封情书 提交于 2019-12-24 07:35:58
问题 I've installed Hadoop eco system on OS X . And I have installed pyhs2 python package in order to connect to hive and query the database. The code I use is as below: import pyhs2 with pyhs2.connect(host='127.0.0.1', port=10000, authMechanism="PLAIN", user='admin', password='1234qwer', database='cards') as conn: with conn.cursor() as cur: #Show databases print cur.getDatabases() #Execute query cur.execute("select * from users") #Return column info from query print cur.getSchema() #Fetch table

Shall the DB ConnectionString within Web.config be encrypted when using Azure Cloud?

五迷三道 提交于 2019-12-24 05:22:00
问题 I have come across this excellent blog explaining how to encrypt/decrypt the database connection string with a PKCS12ProtectedConfigurationProvider inside Azure Cloud. http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-connection-security.aspx#create_aspnet Is this something that should be done, or is it rather security overkill? If Web.config cannot be accessed from internet due IIS restrictions, nobody would be able to read the DB connection string (incl. password etc)

How to connect to MS SQL Server database from ASP using windows authentication specifying a windows user

纵饮孤独 提交于 2019-12-24 04:12:15
问题 I've been trying for just over a month to connect an ASP script here to a SQL Server database but each time I use this connection string: Data Source=dbServer01;Initial Catalog=POS123;Integrated Security=SSPI;User ID=domain\usr;Password=pwd; It ignores the user I specify and takes the machine name to authenticate the connection, which obviously fails. so I change the Integrated Security value to False, like this: Data Source=dbServer01;Initial Catalog=POS123;Integrated Security=False;User ID

How to connect to MS SQL Server database from ASP using windows authentication specifying a windows user

最后都变了- 提交于 2019-12-24 04:12:15
问题 I've been trying for just over a month to connect an ASP script here to a SQL Server database but each time I use this connection string: Data Source=dbServer01;Initial Catalog=POS123;Integrated Security=SSPI;User ID=domain\usr;Password=pwd; It ignores the user I specify and takes the machine name to authenticate the connection, which obviously fails. so I change the Integrated Security value to False, like this: Data Source=dbServer01;Initial Catalog=POS123;Integrated Security=False;User ID

SQL Server Integrated Security from an Azure Web Site

懵懂的女人 提交于 2019-12-24 03:43:24
问题 When running an ASP.Net website on IIS I can specify the Active Directory (AD) username that the website runs in the context of in the App Pool settings. I can then create a connection string with Integrated Security = true to access my database. It's then possible to secure DB resources based on that AD user. Is this possible in Windows Azure when connecting a Web Site to a VM hosting an SQL database? Firstly it does not seem possible to specify the virtual network of the Web Site so I am

Entity Framework: Error with dynamic connection string

瘦欲@ 提交于 2019-12-24 02:32:30
问题 Cheers all, I'm using an Entity Framework model. I need to pass my connection string like parameter, so, in another file, I've written (from this question): namespace MyNamespace.Model { using System; using System.Data.Entity; using System.Data.Entity.Infrastructure; public partial class MyEntities: DbContext { public MyEntities(string nameOrConnectionString) : base(nameOrConnectionString) { } } } When I startup the app, I call this constructor in this way, so I can refer to this from anyway