LINQ to SQL connectionstring

前端 未结 6 2203
南旧
南旧 2020-12-09 22:29

I have an application that I want to be able to configure the connection string for my LINQ to SQL. I\'ve tried so many different ways but cannot seem to get it working. I w

6条回答
  •  情书的邮戳
    2020-12-09 23:26

    You can pass an override connection string into the DataContext constructor:

    var db = new MyDataContext("Data Source=Something Else;")
    

提交回复
热议问题