I have comboBox where user can choose sql database view e.g. basicView, fullView etc.
One of the view is adminView. When user choose adminView new form (form2) is opening and he have to login.
In form1 I have method showDB(string command) which shows View in dgv. But how to do this method after login in form2? Any idea?
I have comboBox where user can choose sql database view e.g. basicView, fullView etc.
Share
You should dedicate form2 to the login process and, if everything goes well, return DialogResult.OK.
For example in Form1:
In Form2 you should have a button with the property DialogResult set to OK.
when the user press this button do your logic to check the login credentials given.
If the credentials are good don’t do anything, the form will close by itself
otherwise
and the form2 will stay opened to let a retry to your user.