got error when i try to connect to sql-server 2008
-
Monday, November 19, 2012 6:02 AM
hi
i have this connection to sql-server 2008:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=INV_TERMINALS;Data Source=TJSQL
and this is my connection code:
public bool Open_PRI_Connection() { LOAD_PRI_Server(); Conn_PRI = new SqlConnection(SQL_PRI_Connection); try { Conn_PRI.Open(); return true; } catch {
return false;
} }
but i get this error: Keyword not supported: 'provider'
i work on C#, WinForm, FW3.5 , sql-server 2008
thanks
All Replies
-
Monday, November 19, 2012 6:16 AM
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=INV_TERMINALS;Data Source=TJSQL
Hello,
That's a connection string for OleDbConnection, not for SqlConnection. Please remove "provider" / use this one instead:
Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=INV_TERMINALS;Data Source=TJSQL
Olaf Helper
Blog Xing- Proposed As Answer by Johnson T A Monday, November 19, 2012 12:28 PM
- Marked As Answer by Kalman TothMicrosoft Community Contributor, Moderator Tuesday, November 27, 2012 9:26 PM
-
Monday, November 19, 2012 8:06 AM
thanks for the help,
I try this:
Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=INV_TERMINALS;Data Source=TJSQL
but still same error: Keyword not supported: 'provider'
-
Monday, November 19, 2012 8:46 AM

