0

hi,

I am having some troubles while trying to connect a database which uses mssql server. Every attempt results with the error "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied."

[INDENT]OleDbConnection conn = new OleDbConnection();[/INDENT]
            conn.ConnectionString = "Provider=SQLOLEDB;Persist Security Info=False;Integrated Security=SSPI;Initial Catalog=voters;Data Source=T_YALTHIS\\SQLEXPRESS;Workstation Id=T_YALTHIS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False";
            string myStr="select email from idMail";
            OleDbCommand myCommand = new OleDbCommand(myStr, conn);
    
            conn.Open();

database name: voters
computer name: t_yalthis
instance name: SQLEXPRESS

I can connect when I run the program on the computer that the database created, but not from a different one.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by abhay_pundir
0

try this

sqlconnection con=new sqlconnection ("provider=t_yalthis/sqlexpress,datasource=voters,Integrated Security=SSPI)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.