简体   繁体   中英

where statement in linq to sql doesn't appear in the list

I create a linq to sql in visual studio so i create a dbcontext object in my asp web form as you can see here :

 public AccidentCongress.dblinqtoDb.dbDataContext dbcontext = new dbDataContext();
        protected void BtnSend_Click1(object sender, EventArgs e)
        {
           if (dbcontext.tblUserInfos.??????)
        } 

I need to select a row in tblUserInfos with where clause but the where clause doesn't in the list why ?

在此处输入图片说明

Make sure you have a using System.Linq; statement towards the top of that file.

"Where" is an extension method which is declared in the System. Linq namespace, so make sure you add "using System.Linq;" to the using section at the top of the cs file.

添加对System.Linq引用或没有using语句

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM