我在调试程序时出错,说无法将“System.Data.DataSet”类型的对象转换为 MyDatabase.DataSet 类型
我需要做什么来修复它
private void btnLogin_Click(object sender, System.EventArgs e)
{
string strUser;
string strPass;
string sMsg = "";
strUser = txtUserID.Text ;
strPass = txtPassword.Text ;
DataSet o_Find = new DataSet ();
Users oUsers = new Users();
try
{
o_Find = (DataSet)oUsers.FindData(strUser,strPass);
sMsg = "Welcome " + o_Find.Tables ["Login"].Rows[0]["UserName"].ToString ();
switch (strUser)
{
case "Admissions":
frmAdmissions admitForm = new frmAdmissions ();
admitForm.Visible = true;
admitForm.Activate();
break;
case "Admin":
case "Nurse":
case "Doctor":
frmMenu menuForm = new frmMenu ();
menuForm.oCurrent.UserName = strUser;
menuForm.Visible = true;
menuForm.Activate();
menuForm.SelectUser();
break;
}
}