我试试这个代码并且它给了我关于'其中'
我验证:using system.linq;
和using System.Data.Entity
但未修复(我使用visual studio 2012 ultimate和sql server 2008 r2)
代码:
public static int updatecondidate(int condidateID, condidate_table updatedcondidateData)
{ int rowAffected = 0;
using (EmployeementSystemEntities DB = new EmployeementSystemEntities())
{
//select condidate for update
condidate_table condidateforupdate = (from anything in DB.condidate_table
where anything.condidate_id == condidateID
select anything).FirstOrDefault();
condidateforupdate.condidate_name = updatedcondidateData.condidate_name;
condidateforupdate.condidate_phone = updatedcondidateData.condidate_phone;
condidateforupdate.condidate_email = updatedcondidateData.condidate_email;
condidateforupdate.condidate_pic = updatedcondidateData.condidate_pic;
rowAffected = DB.SaveChanges();
}
return rowAffected;
}
同样的错误在"选择"
//选择所有condidate
public static List<condidate_table> SelectAllCondidate()
{
using (EmployeementSystemEntities DB = new EmployeementSystemEntities())
{
List<condidate_table> AllCondidate = (from anything in DB.condidate_table
select anything).ToList<condidate_table>();
return AllCondidate;
}
}
答案 0 :(得分:0)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
callbackManager = CallbackManager.Factory.create();
setContentView(R.layout.activity_main);
name = (TextView) findViewById(R.id.name);
mywebView = (WebView) findViewById(R.id.webView);
loginButton = (LoginButton) findViewById(R.id.login_button);
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
name.setText(
"User ID: "
+ loginResult.getAccessToken().getUserId()
+ "\n" +
"Auth Token: "
+ loginResult.getAccessToken().getToken()
);
WebView ourBrow;
ourBrow = (WebView) findViewById(R.id.webView);
// cancel the web intent that default in android setting
ourBrow.setWebViewClient(new myWebViewClient());
String url = "https://m.facebook.com/groups/819387484767105";
// webView settings
ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.getSettings().setLoadWithOverviewMode(true);
ourBrow.getSettings().setUseWideViewPort(true);
ourBrow.getSettings().setDomStorageEnabled(true);
ourBrow.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
ourBrow.getSettings().setUserAgentString("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
ourBrow.loadUrl(url);
}
在我的情况下,我错过了这个:
public List<ISSUES> ListIssues()
{
List<ISSUES> list = new List<ISSUES>();
using (FTUEntities1 db = new FTUEntities1())
{
list = db.ISSUES.Include(a => a.CLIENTS).ToList();
return list;
}
}
答案 1 :(得分:-1)
where anything.condidate_id = condidateID
应为where anything.condidate_id == condidateID
(注意双等号)。
以下是我可以找到的问题的一般列表,人们报告已经为他们造成了同样的错误。我会在发现更多时更新它。
查询语法
=
代替==
c.FullNameReverse
代替c.FullNameReverse()
&&
,||
等...)缺少使用语句
using System.Linq
using System.Data.Entity