database-connection

C# Connecting to Access DB with no install

空扰寡人 提交于 2020-01-16 09:02:31
问题 I have an Access database (.accdb) and I have a WPF application trying to connect to it. It seems that I don't have Microsoft.ACE.OLEDB.12.0; installed. Results of: OleDbEnumerator enumerator = new OleDbEnumerator(); var t = enumerator.GetElements(); var a = "s"; foreach (DataRow row in t.Rows) { Console.WriteLine(row[0]); } on x86 CPU Gives the following results SQLOLEDB MSDMine MSDataShape SQLNCLI11 ADsDSOObject MSOLEDBSQL MSOLEDBSQL Enumerator MSDMine Enumerator SQLNCLI11 Enumerator

how to solve the connection problem with SQL Server

本小妞迷上赌 提交于 2020-01-16 08:44:27
问题 I am trying to connect to my SQL Server 2016 Database using pyodbc with django. In the SQL configuration manager i have all the network configurations as Enabled shared memory Named Pipes TCP/IP FireWall is turned OFF I tried using localhost and it worked fine but when I tried to connect to a server on the same network it did not work and displayed the below error: OperationalError at /connect/ ('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a

how to solve the connection problem with SQL Server

本秂侑毒 提交于 2020-01-16 08:44:01
问题 I am trying to connect to my SQL Server 2016 Database using pyodbc with django. In the SQL configuration manager i have all the network configurations as Enabled shared memory Named Pipes TCP/IP FireWall is turned OFF I tried using localhost and it worked fine but when I tried to connect to a server on the same network it did not work and displayed the below error: OperationalError at /connect/ ('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a

Connect C# to Mysql database

。_饼干妹妹 提交于 2020-01-15 23:37:11
问题 I want to connect to mysql server from C#. I found some code on the net but somewhere there is something wrong because i get A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll error. private void Initialise() { server = "dns to server"; database = "db_name"; uid = "root"; password = "password"; string connectionString; connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";"; OR

Connect C# to Mysql database

不打扰是莪最后的温柔 提交于 2020-01-15 23:36:30
问题 I want to connect to mysql server from C#. I found some code on the net but somewhere there is something wrong because i get A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll error. private void Initialise() { server = "dns to server"; database = "db_name"; uid = "root"; password = "password"; string connectionString; connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";"; OR

Why does a connection have to be open for a nonquery but not to fill a dataset?

拈花ヽ惹草 提交于 2020-01-15 08:44:05
问题 When I connect to a SQL datasource in my C# application, I can fill a dataset using the following code. Note that I am not explictly opening a connection to the datasource. SqlConnection cw_con = new SqlConnection("Server=Server;Database=Database;User=User;password=password"); SqlCommand cmd = new SqlCommand("SELECT * FROM Example WHERE value = value"); cmd.Connection = cw_con; //Create DataSet DataSet cw_ds = new DataSet("cw_ds"); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand =

Can't connect to sqlserver

谁都会走 提交于 2020-01-15 05:32:28
问题 Im trying to install asp.net membership system on a remote sql server but this error shows up: Setup failed. Exception: Unable to connect to SQL Server database. Details of failure System.Web.HttpException (0x80004005): Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed

Connect a C# MVC application to a remote SQL Server database

∥☆過路亽.° 提交于 2020-01-14 10:33:10
问题 I have a SQL Server database located at http://192.168.10.3/MyDB . I have created a C# MVC application, and I need to know the steps to connect my application to the above database. Is it only replacing the connection string in the web.config file ? Data Source=?? ;Initial Catalog=??;Integrated Security=SSPI; User ID=??;Password=pwd; If so what am I to replace where I have placed the ?? sign ? 回答1: DataSource = 192.168.10.3 Initial Catalog = MyDB User ID = whatever sql login you are using to

psql: FATAL: role “postgres” does not exist (with -h localhost option)

孤者浪人 提交于 2020-01-14 09:36:17
问题 I have Postgres installed in my local machine. When I execute psql -U postgres -d buzzsumo it correctly asks for my password to the user postgres. However, when I run psql -U postgres -d buzzsumo -h localhost it gives me this error message: psql: FATAL: role "postgres" does not exist Why is this the case, when in the first example I am connecting to my local server, which is equivalent to passing in localhost? 回答1: You don't say but I'm guessing you're running postgres on either on MacOS or

c3p0 Java Database Pooling, failover configuration

巧了我就是萌 提交于 2020-01-14 07:51:08
问题 When a database is down then automatically the ip and port switch to another db server. How should I configure c3p0 connection pooling of my web apps to follow this Database failover mechanism? Currently, I am using c3p0, however in the last db failover, pool connections failed to reestablished. 回答1: Reestablished after a failing request. Attributes that helps to come over as soon as possible p:testConnectionOnCheckin="true" p:preferredTestQuery="SELECT @@VERSION" p:acquireRetryAttempts="10"