Skip to content

Newbie help

cdog

Asked Apr 6, 2007, 7:03 PM EDT1 answer
Share
LinkedInX
what does this string mean in c#?

String DBConn = ConfigurationManager.ConnectionStrings["TitaniumLMC"].ToString();

also how do you post to a local machine database running sql server?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    VB.NET
    
    Hello,
    
    ConfigurationManager.ConnectionStrings["TitaniumLMC"].ToString() returns the connection string associated to the name "TitaniumLMC" in your app.config file.  By the way, you should rather use ConfigurationManager.ConnectionStrings["TitaniumLMC"].ConnectionString.
    
    In order to post data to a local machine database, just add the local machine's connection string to your app.config file, refer to it as specified previously, create a new SqlConnection and work with SqlCommand/SqlDataReader/SqlDataAdapter.
    
    Simon
    0