请问登录验证权限的问题。
我是这样写的private void buttonEnter_Click(object sender, EventArgs e)
{
int t = 1;
SqlConnection ConnectionLogin = new SqlConnection(@"Server=(local)\sqlexpress;Integrated Security=True;Database=Mydata");
ConnectionLogin.Open();
SqlCommand CommandLogin = ConnectionLogin.CreateCommand();
= "SELECT ID,Password,BuyIn,SellOut,Stat,Register,Append,Printer form IDData";
SqlDataReader ReadLogin = CommandLogin.ExecuteReader();
while (ReadLogin.Read())
{
if (ReadLogin.GetValue(0).ToString() == textBoxID.Text &&
ReadLogin.GetValue(0).ToString() == textBoxPassword.Text)
{
break;
if (ReadLogin.GetInt32(3) >= t)
{
MDI.VToolStripMenuItemBuyIn.Visible = false; //这个提示错误
}
MDI mdi=new MDI();
mdi.Show();
}
}
}
错误内容:
非静态的字段、方法或属性“MyTestData.MDI.VToolStripMenuItemBuyIn”要求对象引用 E:\My Documents\Visual Studio 2005\Projects\MyTestData\MyTestData\Login.cs 35 25 MyTestData
请问这个该如何操作这个MDI窗口中的菜单显示是否啊?