1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

Connection strings in LINQ to SQL

Discussion in 'Microsoft News' started by NewsBot, Apr 28, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    <!--sizeo:3--><span style="font-size:12pt;line-height:100% <!--/sizeo--><!--fonto:Calibri--> Calibri <!--/fonto-->I’m working on my first implementation of LINQ to SQL.* I am curious to know about the connection string used by LINQ when making a connection to the SQL Server database.* I’ve got a strongly typed DataContext class, and looking at the Connection property’s ConnectionString property it looks identical to an ADO.NET connection string to the database.* I see that the DataContext base class has several constructors, of which one is just a <b>string connect</b> parameter (in C#) (actually, according to the online documentation, it is “file or server or connection”).* This, plus what I’ve seen with the <i>Connection.ConnectionString</i> property, suggests that I could pass in a different ADO.NET connection string if I wanted to, when instantiating the strongly typed DataContext object.<!--fontc--><!--/fontc--><!--sizec--><!--/sizec-->
    <!--fonto:Calibri--> Calibri <!--/fonto-->
    <!--sizeo:3--><span style="font-size:12pt;line-height:100% <!--/sizeo--><!--fonto:Calibri--> Calibri <!--/fonto-->I want to verify that what I’m thinking is correct, please.<!--fontc--><!--/fontc--><!--sizec--><!--/sizec-->
    <!--fonto:Calibri--> Calibri <!--/fonto--><!--fontc--><!--/fontc-->
    <!--sizeo:3--><span style="font-size:12pt;line-height:100% <!--/sizeo-->I am using Visual Studio 2008 Pro.
    <!--fontc--><!--/fontc--><!--sizec--><!--/sizec-->




     

Share This Page