C# and MS access
can i talk to anyone about my project in C# and MS and to explain it in details i have just few problem about some code i don't know how to used.. and also to send my project?? so i show full project?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mahesh ChandRank #1 · 393.3K reputationPosted May 13, 2012, 2:03 PM EDT
ali saad9 reputationPosted May 13, 2012, 2:45 PM EDT
i created Ms access
user{UserId, userType, Username, userpass}
employee{Employeeid, employeecde, employeepass,......etc}
and i created a login form contain {combobox to chose if the user is admin or employee}
and two textBoxes for username and password ..
so i conected to my database(both of admin and user can access a MDIParent(admin, departments, salary, attendance, ...etc) after login ) BUT for the employee when he login, the i want to write if statment for employee like if(combobox="employee")
{
to make these forms invisible for him
like
MDIparent.MasterToolStripMenuItem.Visible = false;
MDIparent.EmployeeToolStripMenuItem.Visible = false;
MDIparent.SearchToolStripMenuItem.Visible = false;
MDIparent.LeaveToolStripMenuItem.Visible = false;
MDIparent.EarnToolStripMenuItem.Visible = false;
MDIparent.DeductionToolStripMenuItem.Visible = false;
MDIparent.events.Visible = false;
}
but i tried with it alot and i couldn't solve it :(
Kunal VaishyaRank #990 · 2K reputationPosted May 13, 2012, 9:45 PM EDT
firstly you should read about all C# syntax
use == for comparing
==
if(combobox1.Text == "employee")
{
// to make these forms invisible for him like
MDIparent.MasterToolStripMenuItem.Visible = false;
MDIparent.EmployeeToolStripMenuItem.Visible = false;
MDIparent.SearchToolStripMenuItem.Visible = false;
MDIparent.LeaveToolStripMenuItem.Visible = false;
MDIparent.EarnToolStripMenuItem.Visible = false;
MDIparent.DeductionToolStripMenuItem.Visible = false;
MDIparent.events.Visible = false;
}
second as per your you want to set dynamic Menu rights as per employee ok so
try this if get any problem then let me know the code so we can help you