SUNIL GUTTA

SUNIL GUTTA

  • NA
  • 1k
  • 393.9k

Connection string & sql server problem ?

Feb 26 2013 1:43 PM
Hi friends

Well coming to my issue

I planned to test my connection using " State " member of connection class . so i have written 
Logic : 

Declarations: using System.Data.OleDb;

private void button1_Click(object sender, EventArgs e)
        {

            OleDbConnection con = new OleDbConnection("provider=SqlOleDb;Integrated Security =SSPI;Database=Master");
            con.Open();
            MessageBox.Show(con.State.ToString());
            con.Close();
            MessageBox.Show(con.State.ToString());
        }

under button when i click it i should tell me the status of connection :)

But i am facing errors like  : Invalid authorization specification
                                            Invalid connection string attribute

some other time :[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

I installed SQL server 2008 on my local machine :) 

Any ideas about this :)

Thank you 

Answers (9)