Connection String of Sql server

This is different kind of  conncetion string

  • string connStr = ConfigurationManager.ConnectionStrings[“TutTestConn”].ToString();
  • string sFilePath = AppDomain.CurrentDomain.BaseDirectory + “App_Data\\RAGDatabase.mdf”; string connString = “Data Source=.\\SQLEXPRESS; AttachDbFilename=” + sFilePath + “; Integrated Security=True; User Instance=True”; m_oSqlConnection = new SqlConnection(connString); m_oSqlConnection.Open();
  • string connString = “Data Source=server ip; Initial Catalog=database_name; User ID=id;Password=pwd; Trusted_Connection=False;”;
  •  string connString = “Data Source=erver name; Initial Catalog=database_name; User ID=id;Password=pwd; Trusted_Connection=False;”;
                   
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s