Site db = new Site();
           var query = from sn in db.SiteName _   <=you forgot underscore,
mate !
           select sn;




On Mon, Nov 23, 2009 at 10:08 PM, Greg <[email protected]> wrote:

> I have a program that I am starting to write that uses LINQ to fetch
> SQL information.
> I add a Linq to SQL class and it is called site with the Site ID being
> the primary key that is an autogenerated number and the SiteName which
> is a varchar(50). Neither field allows nulls.
>
> so now the code giving me an issue
>
>  Site db = new Site();
>            var query = from sn in db.SiteName   //<===== This line is
> erroring out
>            select sn;
>
>
> With the error
> ArgumentNullException was unhandled
> Value cannot be null.
> Parameter name: source
>
> I do not understand why this is happening. I am just quesrying the
> data (only 3 items in table)
>
> Can anyone explain to me what am I missing here?
>
>

Reply via email to