______________________________________________________ LINQ Errors DataContext Will Not Compiler Ron Kessler 6/16/09 _______________________________________________________ When you create a new Datacontext from the designer, sometimes you get an error when you create a reference to your dc like in the line below. Notice I reference my new AdventureWorksDataContext(); without any argument. If you get an error that says "DataContext does not contain a constructor that takes '0' arguments", it is because the connection string info has been lost. Here is how to fix it: 1. Open up the datacontext in the relational designer. 2. Rt. click on the white space and choose properties. 3. Expand the ConnectionString property and select your conn string. 4. Also make sure the Application Settings property = false (inside the conn string section) It should work now. When the conn data is gone, the compiler expects you to pass the conn to the constructor. The constructor does not have an overloaded method to accept no arguments so you get htis error. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Paging : System.Web.UI.Page { AdventureWorksDataContext dc = new AdventureWorksDataContext(); }