本文介绍了编译器错误CS0119 PLZ帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我在登录点击按钮中所建议的代码,如主席所建议的那样:
This is my code in the login click button as Sir suggested:
private void btnLogin_Click(object sender, EventArgs e)
{
AppDatabase1DataSet ds = new AppDatabase1DataSet ();
AppDatabase1DataSet .LoginDataTable dt = new AppDatabase1DataSet.LoginDataTable ();
AppDatabase1DataSet.LoginDataTable();
this.loginTableAdapter1 .Fill (dt) ;
foreach (DataRow dr in dt .Rows )
{
if(dr[0].ToString()==txtuname .Text && dr[1].ToString()== txtpassword.Text )
{
txtpassword.Text = "";
txtpassword.Text = dr[0].ToString();
MessageBox.Show("Login Succeeded");
}
我已经相应地定义了所有内容,但此错误在LoginDataTable()行上弹出:
错误1"csharp_phonebk.AppDatabase1DataSet.LoginDataTable"是类型",在给定上下文中无效
我不知道为什么...请尽快给我答复.
I''ve defined everythings accordingly but this error pops up on the LoginDataTable() line:
Error1 ''csharp_phonebk.AppDatabase1DataSet.LoginDataTable'' is a ''type'', which is not valid in the given context
I don''t know why...Please answer me asap.
推荐答案
写道:
AppDatabase1DataSet.LoginDataTable();
AppDatabase1DataSet.LoginDataTable();
在这里,您使用LoginDataTable作为方法.但是,由于它是一个类,因此会出现错误.
Here you are using LoginDataTable as a method. But since it is a class, you are getting the error.
这篇关于编译器错误CS0119 PLZ帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!