Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# new linq to sql file problem

C# new linq to sql file problem

Scheduled Pinned Locked Moved C#
csharpquestiondatabasedotnetlinq
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dcof
    wrote on last edited by
    #1

    In a C# 2010 application, I created a new linq to sql (*.dbml) file. When this occurred, the .net framework created a default connection string. However I want the *.dml file to use the connection string I specify. to solve this problem, I have the following questions: 1. When I do create a new .dbml file, how to I make the .net framework use the connection string I want to use and not come up with a default connection string? 2. For an existing .dbml file that I added to the application, how can I change the default connection string to the value I really want to be used?

    V 1 Reply Last reply
    0
    • D dcof

      In a C# 2010 application, I created a new linq to sql (*.dbml) file. When this occurred, the .net framework created a default connection string. However I want the *.dml file to use the connection string I specify. to solve this problem, I have the following questions: 1. When I do create a new .dbml file, how to I make the .net framework use the connection string I want to use and not come up with a default connection string? 2. For an existing .dbml file that I added to the application, how can I change the default connection string to the value I really want to be used?

      V Offline
      V Offline
      vinodkrebc
      wrote on last edited by
      #2

      Whenever you create instance of DataContext pass the connectionstring in the constructor. This way you will be able to bypass the default connectionstring.

      http://www.exploresilverlight.com Cheers! Vinod

      D 1 Reply Last reply
      0
      • V vinodkrebc

        Whenever you create instance of DataContext pass the connectionstring in the constructor. This way you will be able to bypass the default connectionstring.

        http://www.exploresilverlight.com Cheers! Vinod

        D Offline
        D Offline
        dcof
        wrote on last edited by
        #3

        can you show me a code example of what you are referring to?

        V 1 Reply Last reply
        0
        • D dcof

          can you show me a code example of what you are referring to?

          V Offline
          V Offline
          vinodkrebc
          wrote on last edited by
          #4

          TestDataContext dataContext = new TestDataContext("connectionstring");

          http://www.exploresilverlight.com Cheers! Vinod

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups