Unknown connection option in connection string: provider.
-
Hi guys, I develop a csharp smart device application In order to establish a TCP/IP connection to my .mdf database,I use the above connection string:
string sConnection = "Provider=SQLOLEDB;Data Source=127.0.0.1,7438;Persist Security Info=True;Network Library=dbmssocn;Initial Catalog=GMAO;User ID=sa;Password=sa";
where the Data source is the @of my server that I found due the netstat -an command:
C:\Users\Admin>netstat -an
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:7 0.0.0.0:0 LISTENING
TCP 0.0.0.0:9 0.0.0.0:0 LISTENING
TCP 0.0.0.0:13 0.0.0.0:0 LISTENING
TCP 0.0.0.0:17 0.0.0.0:0 LISTENING
TCP 0.0.0.0:19 0.0.0.0:0 LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:515 0.0.0.0:0 LISTENING
TCP 0.0.0.0:990 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2103 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2105 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2107 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2383 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49156 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49159 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49160 0.0.0.0:0 LISTENING
TCP 0.0.0.0:54667 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1434 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1801 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5679 0.0.0.0:0 LISTENING
TCP 127.0.0.1:7438 0.0.0.0:0 LISTENING
TCP 127.0.0.1:49172 127.0.0.1:49173 ESTABLISHE
TCP 127.0.0.1:49173 127.0.0.1:49172 ESTABLISHE
TCP 127.0.0.1:49185 127.0.0.1:49186 ESTABLISHE
TCP 127.0.0.1:4918 -
Hi guys, I develop a csharp smart device application In order to establish a TCP/IP connection to my .mdf database,I use the above connection string:
string sConnection = "Provider=SQLOLEDB;Data Source=127.0.0.1,7438;Persist Security Info=True;Network Library=dbmssocn;Initial Catalog=GMAO;User ID=sa;Password=sa";
where the Data source is the @of my server that I found due the netstat -an command:
C:\Users\Admin>netstat -an
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:7 0.0.0.0:0 LISTENING
TCP 0.0.0.0:9 0.0.0.0:0 LISTENING
TCP 0.0.0.0:13 0.0.0.0:0 LISTENING
TCP 0.0.0.0:17 0.0.0.0:0 LISTENING
TCP 0.0.0.0:19 0.0.0.0:0 LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:515 0.0.0.0:0 LISTENING
TCP 0.0.0.0:990 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2103 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2105 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2107 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2383 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49156 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49159 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49160 0.0.0.0:0 LISTENING
TCP 0.0.0.0:54667 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1434 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1801 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5679 0.0.0.0:0 LISTENING
TCP 127.0.0.1:7438 0.0.0.0:0 LISTENING
TCP 127.0.0.1:49172 127.0.0.1:49173 ESTABLISHE
TCP 127.0.0.1:49173 127.0.0.1:49172 ESTABLISHE
TCP 127.0.0.1:49185 127.0.0.1:49186 ESTABLISHE
TCP 127.0.0.1:4918Are you using SqlConnection? In that case you do not need to give "provider". If you are getting access denied errors, check if the server allows remote connections using TCP/IP and Server browser service is running. Also check if the provided credentials have access to the server.
-
Are you using SqlConnection? In that case you do not need to give "provider". If you are getting access denied errors, check if the server allows remote connections using TCP/IP and Server browser service is running. Also check if the provided credentials have access to the server.
Hi, I use sqlConnection because I need to connect to .mdf database in a smart device application.The server is local and allows TCP/IP connection.The server browser is running. U last sentence "Also check if the provided credentials have access to the server.",I don't understand it Thanks :) :)
-
Hi, I use sqlConnection because I need to connect to .mdf database in a smart device application.The server is local and allows TCP/IP connection.The server browser is running. U last sentence "Also check if the provided credentials have access to the server.",I don't understand it Thanks :) :)
-
Hi, Do u mean by attach database file by:join the database file to database field in sql server?If this,I do it. My code is below:
private void Form6_Load(object sender, EventArgs e)
{string sConnection = "Data Source=127.0.0.1,1433;Persist Security Info=True;Initial Catalog=GMAO;User ID=sa;Password=sa"; string sSQL = "SELECT \[M-MO\] FROM Marge; "; SqlConnection conn = new SqlConnection(sConnection); SqlCommand comm = new SqlCommand(sSQL, conn); SqlDataReader dr = null; try { comm.Connection.Open(); dr = comm.ExecuteReader(); while (dr.Read()) comboBox1.Items.Add(dr\[0\]); } catch (SqlException ex) { //MessageBox.Show("connexion impossible"); MessageBox.Show(ex.Message); return; } dr.Close(); comm.Connection.Close(); }
If the program connects to the server,it will fill the combobox with data of the select statement. But,the error"Specified sql server not found or access denied :(( lets me cry. Thanks
-
Hi, Thanks I depass the problem of the connexion to the server due to the DB File attachmen :laugh: Still now the problem in the filling of my combobox.In fact,no exception appears so connection to server works well.In other hand,nothing is added to my combobox. I try to replace my sqldatareader by sqldataset but still the same thing:
string sConnection = "Data Source=127.0.0.1,1433;Persist Security Info=True;Initial Catalog=GMAO;User ID=sa;Password=sa";
string sSQL = "SELECT com FROM energie; ";
SqlConnection conn = new SqlConnection(sConnection);
SqlCommand comm = new SqlCommand(sSQL, conn);
DataSet ds = new DataSet();
SqlCeDataAdapter da = new SqlCeDataAdapter();
SqlDataReader dr = null;
try
{comm.Connection.Open(); da.Fill(ds, "SQL Temp Table"); foreach(DataRow d in ds.Tables\[0\].Rows) comboBox1.Items.Add(d.ToString()); } catch (SqlException ex) { //MessageBox.Show("connexion impossible"); MessageBox.Show(ex.Message); return; } dr.Close(); comm.Connection.Close(); }
How do I depass that??? Thank u
-
Hi guys, I develop a csharp smart device application In order to establish a TCP/IP connection to my .mdf database,I use the above connection string:
string sConnection = "Provider=SQLOLEDB;Data Source=127.0.0.1,7438;Persist Security Info=True;Network Library=dbmssocn;Initial Catalog=GMAO;User ID=sa;Password=sa";
where the Data source is the @of my server that I found due the netstat -an command:
C:\Users\Admin>netstat -an
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:7 0.0.0.0:0 LISTENING
TCP 0.0.0.0:9 0.0.0.0:0 LISTENING
TCP 0.0.0.0:13 0.0.0.0:0 LISTENING
TCP 0.0.0.0:17 0.0.0.0:0 LISTENING
TCP 0.0.0.0:19 0.0.0.0:0 LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:515 0.0.0.0:0 LISTENING
TCP 0.0.0.0:990 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2103 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2105 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2107 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2383 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49156 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49159 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49160 0.0.0.0:0 LISTENING
TCP 0.0.0.0:54667 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1434 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1801 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5679 0.0.0.0:0 LISTENING
TCP 127.0.0.1:7438 0.0.0.0:0 LISTENING
TCP 127.0.0.1:49172 127.0.0.1:49173 ESTABLISHE
TCP 127.0.0.1:49173 127.0.0.1:49172 ESTABLISHE
TCP 127.0.0.1:49185 127.0.0.1:49186 ESTABLISHE
TCP 127.0.0.1:4918First, did you notice that when you wrote the connection string, you used a comma to identify the port instead of a colon?
Data Source=127.0.0.1**,**7438
Also, are you sure the SQL Server isn't listening on port 1434 or that it is running? If SQL server is listening on port 1433, then you need to use the port it's listening on.
-
First, did you notice that when you wrote the connection string, you used a comma to identify the port instead of a colon?
Data Source=127.0.0.1**,**7438
Also, are you sure the SQL Server isn't listening on port 1434 or that it is running? If SQL server is listening on port 1433, then you need to use the port it's listening on.
Hi William, I just posted the solution:http://www.codeproject.com/Messages/3468528/Re-Unknown-connection-option-in-connection-string-.aspx[^] Thanks a lot if u try to help me to depass this new problem :) Note:Plz William how can I pass the solution of a thread I opened and all moderators who try to help me with their suggestions show this solution??? :)