Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
open a new form with different user
oz Fa
Mar 27 2016 2:02 PM
423
Reply
I want to access a same form but with two types of users : user and admin
here is my code :
public void Menu_Load(object sender, EventArgs e)
{
cnx.Open();
SqlCommand cmd1 = new SqlCommand("select * from utilisateur where privilege='User' ", cnx);
int a1 = cmd1.ExecuteNonQuery();
cnx.Close();
if (a1!=0)
{
gestionToolStripMenuItem1.Visible = false;
toolStripLabel1.Text = "user";
}
cnx.Open();
SqlCommand cmd = new SqlCommand("select * from utilisateur where privilege='Admin' ", cnx);
int a = cmd.ExecuteNonQuery();
cnx.Close();
if (a != 0)
{
gestionToolStripMenuItem1.Visible = true;
toolStripLabel1.Text = "admin";
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Crystal Reports in C#
sum timespan in gridview asp.net