Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding Linq-to-Sql class breaks simple ASP.NET web application
    text
    copied!<p>Using VS2012, latest SP/update applied.</p> <p>I have been very frustrated trying to get an ObjectDataSource to work. See <a href="http://bit.ly/XTpdvN" rel="nofollow">http://bit.ly/XTpdvN</a> and <a href="http://bit.ly/XTpsHi" rel="nofollow">http://bit.ly/XTpsHi</a>.</p> <p>I started a new Web Application project, compiling and running after each step, trying to make the steps as granular as possible. </p> <p>1) Create new empty web application.<br> 2) Add WebForm1.aspx.<br> 3) Clean, rebuild, run (either View in Browser or in debugger).<br> 4) Add new class to App_Code.<br> 5) Repeat #3.<br> 5) Add existing .mdf to App_Data.<br> 6) Repeat #3.<br> 7) Add Linq-to-Sql class to App_Code (Items.dbml). Leave it empty.<br> 8) Clean, Rebuild, run in Debugger: </p> <blockquote> <p>Compiler Error Message: CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)<br> Source Error: </p> <p>Line 12: namespace ODS_Restart.App_Code Line 13: { Line 14: using System.Data.Linq; Line 15: using System.Data.Linq.Mapping; Line 16: using System.Data;</p> </blockquote> <p>As far as I can tell, there is nothing in the code in App_Code that needs Linq: </p> <pre><code>namespace ODS_Restart.App_Code { public class BAL { public static List&lt;string&gt; GetCountries() { return new List&lt;string&gt;() { "USA", "Aus", "NZ"}; } } } </code></pre> <p>As I said, very frustrating. Any insight on how to get past this problem would be greatly apprectiated....</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload