Hi. Thanks for your tutorial but i already know this even have created a complete application with a single login form where user will select their role and get logged in to their dashboard. But the same process follow for both a single user app and multi user. Do you have such experience on how to deploy and run c# application with centralized database on multiple computers?
hello, thanks for your work.I have a question, ı am making a project and ı dont know should i am write sql connection and datatable in every form code ?
I'm unable to add the DB i've created to Visual Studio first, when i tried to add a connection it asked me for some needed installation to be done and then it started to install it after it finished i've found my server exist on the data connection but i couldn't follow the method you mentioned which specify the DB i've created and when i try to add another data connection i couldn't find the seer, so i typed the name of the server manually but i couldn't find my added database
i want to know how to handle error when the user do not enter any value and do not select the combobox, because when i click button login without entring any value it is get me an error.
[[ERROR]] An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll Additional information: Instance failure. HAVING ERROR WHILE EXCECUTING. I BADLY NEED YOUR HELP.i NEED TO RUN THIS FOR TOMORROW DEADLINE.
the cmbItemValue doesn't want to work by me... I already had my own code but all I needed was to make it multi user login. But with cmbvalue it just tells me it can't be found. Any idea why perhaps?
@@RunCodes I relooked at yours and then mine again and realized I just made an idiotic mistake on my end, still studying these things and have to learn a lot and your videos are actually helping a lot :P
hello can you help me please ? i am making a login form with a combobox with multiple choice. but ı want to the items will come from sql not in combobox items. please help me . ı dont want to write cmbselected items. ı am new in coding please help.
How to Link ComboBox with Database and show values in TextBox if Select ComboBox in C#.NET? ruclips.net/video/jhXJwE8QdUE/видео.html watch this video to solve your problem!
Hi, Can I ask for a help, I tried the concept of your code to my project. The difference is I don't have a combo box for user type. What I want to happen is to open Form2 if the user type is admin, and open Form3 if the user type is equal to user, but all of this without that combo box from the form. I tried this but I had trouble with sda. Can you help me with this one? Looking forward to hearing from you. Thank you.
When I execute the program the sda.Fill(dt); the error is "An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll" Please answer
It says System.NullReferenceException: 'Object reference not set to an instance of an object.' plus the usertype is not showing in the combobox how to fix this?
Is it possible to create a personal dashboard that is user-specific not by roles in windows forms? You know by using sql database to store User logins and then whenever a specific user logs in he/she is then redirected to a personal profile windows form that is tied to his/her account?
I have one error pls anyone can solve it would be great help, I am writing USERNAME as user and In PASSWORD i am writing my password and In SELECT TYPE i am selecting admin, And when i clicked on login button it's showing me YOUR ARE LOGIN AS ADMIN, Which is wrong it's should show me YOUR ARE LOGIN AS USER. Pls anyone can solve this error, reply to this comment
hmmm......my system got auto increment user id, I wanna ask, after login into the system, how do i make the user id of the logged in user also recorded as the logged in user key in data into the system, pls, I need ur help ;_;
after login, what I want is whenever the user insert information, their auto increment user id got inserted as well in the createby column, user id is pk in users table, but foreign key in the information table.......its like after clicking login button, the system hold the userid of the logged in user......how do I do tht and retrieve it so tht it will be recorded as the user inserting the information....;_;
it is not showing other forms not displaying any message only if you use a wrong credential it gives error! and it is also throwing null execption...please help Dim con As SqlConnection = New SqlConnection("Data Source=CHIEF;Initial Catalog=Kololo;Integrated Security=True") Dim cmd As SqlCommand = New SqlCommand("select * from login where username='" & txtUserName.Text & "' and userpassword='" + txtpassword.Text & "'", con) Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd) Dim dt As DataTable = New DataTable() sda.Fill(dt) Dim cmbItemValue As String = Cuserlevel.SelectedItem.ToString() If (dt.Rows.Count > 0) Then Dim i As Integer = 0 Do While (i < dt.Rows.Count) If (dt.Rows(i)("usertype").ToString = cmbItemValue) Then MessageBox.Show(("you are login as " + dt.Rows(i)(2))) If (Cuserlevel.SelectedIndex = 0) Then Dim f As New Dashboard f.Show() Me.Hide() Else Dim ff As New Supplier_Details Me.Hide() ff.Show() End If End If i = (i + 1) Loop Else MessageBox.Show("error") End If
Dim cmd As SqlCommand = New SqlCommand("select * from login where username='" & txtUserName.Text & "' and userpassword='" + txtpassword.Text & "'", con) here is error userpassword='"&txtpassword.Text&"'
Watch this! Configure Visual Studio 2022 for .NET, .NET Framework and .NET Core? Win Form | SQL Server Database ruclips.net/video/rOhuQYKE2iQ/видео.html
@@RunCodes this is my code MySqlCommand cmd = new MySqlCommand("SELECT * FROM `users` WHERE `username` = '"+tbuser.Text+ "'AND `password` = '" + tbpass.Text + "'", connection); MySqlDataAdapter sda = new MySqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); String cmb = comboBox1.SelectedItem.ToString(); if (dt.Rows.Count > 0) { for (int i = 0; i>dt.Rows.Count; i++) { if (dt.Rows[i][3].ToString()== cmb) { MessageBox.Show("You are logged in as " + dt.Rows[i][3]); if (comboBox1.SelectedIndex == 0) { admin ad = new admin(); ad.Show(); this.Hide(); }
I had same error and I had forgot to add 'con' variable in SqlCommand. Example: SqlCommand cmd = new SqlCommand("select * from Main_login where Username='"+txtuser.Text+"' and Password='"+txtpass.Text +"'",con);
I messaged you on facebook just wondering if you could respond as I am having error every single time even if the right details. This would be great if u could message me back and we could fix this
Check this new method! How to Create a User Registration Form in C#.NET using SQL Server Database and Visual Studio 2022? ruclips.net/video/TUKjALf7oOc/видео.html
you deserve double thumb up. you are just the answer to my prayer and research
After watching too many videos, only you could help me
I will try this tonight for my project.I will edit my comment if it worked 😊
This video deserves way more likes and views lmao
Hi. Thanks for your tutorial but i already know this even have created a complete application with a single login form where user will select their role and get logged in to their dashboard.
But the same process follow for both a single user app and multi user.
Do you have such experience on how to deploy and run c# application with centralized database on multiple computers?
if username and password is ok but UserType(comboBox selection is empty or blank) the code goes into exception
thank you so much bro, Lov from MALAYSIA
Sir the massage of successful login and opening the form command is not working with me, What should I do?
May be the logic is not working so check you code properly
Can u tell me how can we use radio button for user type in a replace of combo box...?
what's the changes of coding when we use 2 radio buttons
hello, thanks for your work.I have a question, ı am making a project and ı dont know should i am write sql connection and datatable in every form code ?
Possibly yes!
@@RunCodes really thanks 👍🙏 and i have another question i wrote this code , when i click to login my PC pause
Dont know what going on with your PC, if your program run infinity this may be happened if not other hardware problem may persist!
@@RunCodes thank you 🙏
I'm unable to add the DB i've created to Visual Studio
first, when i tried to add a connection it asked me for some needed installation to be done and then it started to install it after it finished i've found my server exist on the data connection but i couldn't follow the method you mentioned which specify the DB i've created
and when i try to add another data connection i couldn't find the seer, so i typed the name of the server manually but i couldn't find my added database
Restart your server and try creating new project!
Very nicely explained. Keep up brother, well done ;)
i want to know how to handle error when the user do not enter any value and do not select the combobox, because when i click button login without entring any value it is get me an error.
if txtUser.Text==""{
MessageBox.Show("Please enter username)
}else{
//yourcode
}
[[ERROR]]
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll
Additional information: Instance failure.
HAVING ERROR WHILE EXCECUTING. I BADLY NEED YOUR HELP.i NEED TO RUN THIS FOR TOMORROW DEADLINE.
you may have done such a operation which is supposed not to perform! Check your query!
@@RunCodes
sda.Fill(dt) ERROR
Use visual studio 2015
the cmbItemValue doesn't want to work by me... I already had my own code but all I needed was to make it multi user login. But with cmbvalue it just tells me it can't be found. Any idea why perhaps?
because you didn't defined it!
@@RunCodes I relooked at yours and then mine again and realized I just made an idiotic mistake on my end, still studying these things and have to learn a lot and your videos are actually helping a lot :P
the code is incomplete, also don't see the point of having 2 extra empty forms. Thanks for the refresher, but complete working project would help.
hello can you help me please ? i am making a login form with a combobox with multiple choice. but ı want to the items will come from sql not in combobox items. please help me . ı dont want to write cmbselected items. ı am new in coding please help.
How to Link ComboBox with Database and show values in TextBox if Select ComboBox in C#.NET?
ruclips.net/video/jhXJwE8QdUE/видео.html watch this video to solve your problem!
how do i connect to a server and get the database file on the side of the sql applacation
learn.microsoft.com/en-us/sql/integration-services/import-export-data/start-the-sql-server-import-and-export-wizard?view=sql-server-ver16
Thank You very much Bro
Bro the i'm having this error System.Data.SqlClient.SqlException: 'Incorrect syntax near 'login'.' in the sda.Fill(dt); can anyone help me please ?
you have error in your sql query check that!
I got error while running the code
SQL exception was unhandled (incorrect syntax near 'admin')
Please sir help me🙏
check your query there is an error!
Hi,
Can I ask for a help, I tried the concept of your code to my project. The difference is I don't have a combo box for user type. What I want to happen is to open Form2 if the user type is admin, and open Form3 if the user type is equal to user, but all of this without that combo box from the form. I tried this but I had trouble with sda.
Can you help me with this one? Looking forward to hearing from you. Thank you.
Process is same just remove combobox code!
Thank you brother I get great benefit from your video
When I execute the program the sda.Fill(dt); the error is "An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll"
Please answer
jhanine arriola did you fix it
It says System.NullReferenceException: 'Object reference not set to an instance of an object.' plus the usertype is not showing in the combobox how to fix this?
Contact us at facebook.com/TechSupportNep
mine didn't work no errors nothing didnt go to the form 1 :(
Contact us on facebook!
Error at of (dt.Rows.Count >0)
Rows!!! Underline Red !
Pls help me😭
dt.Rows.Count()>0
what if we didn't select the usertype can you please share the validation for combobox ?
Yes you can!
what if we dont want to ask from them if they are admin or user
Check only usertype! So write only usertype query in select query!
Is it possible to create a personal dashboard that is user-specific not by roles in windows forms? You know by using sql database to store User logins and then whenever a specific user logs in he/she is then redirected to a personal profile windows form that is tied to his/her account?
Sure!
Sir not working... I can't switch to form 2 /3 it's just executing the error block " error"
Means error in your query!
@@RunCodes yes sir , i did it thank you 😇
cannot see may dbo file pls help i created the login table but cant see dbo file
create database on sql server!
I have error in sda.(fill)
Error is an expression of non boolean type specified in context where a condition is expected, near 'id'.
sda.Fill(dt)
@@RunCodes pls tell how to solve this
@@RunCodes yes typing mistake it is sda.Fill(dt)
check your sql query there may be mistake
I follow your instruction but at the end error... column usertype does not belong to the table
Your column name maynot usertype! So write your column name or use index 2
if we are not selected any user type then come error how to solve it pls help me
Thats what we are creating in this project!
I did exactly same as you said but its showing me the error that colomn usertype is not present in table but its there wht should i do
it means there is no such column in your database! Use same database column that you create in your sql server!
@@RunCodes i have used the same but then too its showing error🤦🏻♀️
@@RunCodes what should I do now?🤔
may be you used wrong table name! The problem is in your query, check it!
@@RunCodes ok
What if i didn't add any value in textbox and combox. Will they return error or? :/
nope! for this you have to validate!
I have one error pls anyone can solve it would be great help,
I am writing USERNAME as user and
In PASSWORD i am writing my password and
In SELECT TYPE i am selecting admin,
And when i clicked on login button it's showing me YOUR ARE LOGIN AS ADMIN,
Which is wrong it's should show me YOUR ARE LOGIN AS USER.
Pls anyone can solve this error, reply to this comment
Check your sql query!
hmmm......my system got auto increment user id, I wanna ask, after login into the system, how do i make the user id of the logged in user also recorded as the logged in user key in data into the system, pls, I need ur help ;_;
Access your user id from database while logging in and when you logged in simply insert that id into your database!
@@RunCodes ............can u please give me an example?
after login, what I want is whenever the user insert information, their auto increment user id got inserted as well in the createby column, user id is pk in users table, but foreign key in the information table.......its like after clicking login button, the system hold the userid of the logged in user......how do I do tht and retrieve it so tht it will be recorded as the user inserting the information....;_;
for me after log in as a user he message that you are log in as a admin why ? why not user
Review your code!
How to create Log-in System (Log-In and Log-Out) with Log-in history complete with Database sql
Sir can you create same manner program in web application in c# for login page
Okey
thank you sir.... your video help me lot to make user login page
Thanks very much ,precise and simple
Dear friend.
Visit channel Solve My Programming Task. Thank you.
thank you so much ... it helped me a lot...once again tq so much....!!!!!
Really Help full. Thank you so much!
it is not showing other forms not displaying any message only if you use a wrong credential it gives error! and it is also throwing null execption...please help
Dim con As SqlConnection = New SqlConnection("Data Source=CHIEF;Initial Catalog=Kololo;Integrated Security=True")
Dim cmd As SqlCommand = New SqlCommand("select * from login where username='" & txtUserName.Text & "' and userpassword='" + txtpassword.Text & "'", con)
Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
Dim cmbItemValue As String = Cuserlevel.SelectedItem.ToString()
If (dt.Rows.Count > 0) Then
Dim i As Integer = 0
Do While (i < dt.Rows.Count)
If (dt.Rows(i)("usertype").ToString = cmbItemValue) Then
MessageBox.Show(("you are login as " + dt.Rows(i)(2)))
If (Cuserlevel.SelectedIndex = 0) Then
Dim f As New Dashboard
f.Show()
Me.Hide()
Else
Dim ff As New Supplier_Details
Me.Hide()
ff.Show()
End If
End If
i = (i + 1)
Loop
Else
MessageBox.Show("error")
End If
the code is in vb.net
Dim cmd As SqlCommand = New SqlCommand("select * from login where
username='" & txtUserName.Text & "' and userpassword='" +
txtpassword.Text & "'", con)
here is error userpassword='"&txtpassword.Text&"'
thank you but i already corrected the error still doesnt open the form
please help
I will test in my pc and I will inform you but now I have no pc tomorrow I will comment the complete working code ok! Wait until tomorrow!
can anyone in other computer can access or save data in your database created ?
Sure!
i am having a problem getting msql database connected in visual studio
add assembly!
Sir how will come txtuser.text at 8:09
that is what we give the textbox name!
Thank you! Amazing video.
Nice 👍 video sir jee aap ka bhut bhut sukriya
can you make same like this without needed a combox to verify the usertype for user's pleaseee?.
that's not possible!
Hello this doesn’t work when I press login for me
Have a look at your query
It worked Thank you👏
I got mistake with sda.Fill(dt) can u help me ?
error plz!
@@RunCodes system.invalidoperationexception fill selectcommand.connection property has not been initialized
Code plz
@@RunCodes send me your email i will send you my code
here-> facebook.com/TechSupportNep
worth the watch
Not working for me
Nothing happened when click on login button
same
my server name wont pop up and nither my database name
Watch this! Configure Visual Studio 2022 for .NET, .NET Framework and .NET Core? Win Form | SQL Server Database
ruclips.net/video/rOhuQYKE2iQ/видео.html
error at sda.Fill(dt) not working...
contact us of facebook!
Very helpful dear
Anybody get error 40 when trying to connect to database
Can it work on mvc ?
Sure!
i'm Error in sda.Fill(dt);
have a look at your code!
@Pairin Pandith I have same problem and it did not work on me.smh
you an three layer for project this ?
what do you mean?
nothing happens when i press login. why???
You have to write code inside the clicking event of login button!
@@RunCodes i did that. im using mysql from myphp localhost. should i use a different code
@@RunCodes this is my code
MySqlCommand cmd = new MySqlCommand("SELECT * FROM `users` WHERE `username` = '"+tbuser.Text+ "'AND `password` = '" + tbpass.Text + "'", connection);
MySqlDataAdapter sda = new MySqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
String cmb = comboBox1.SelectedItem.ToString();
if (dt.Rows.Count > 0)
{
for (int i = 0; i>dt.Rows.Count; i++)
{
if (dt.Rows[i][3].ToString()== cmb)
{
MessageBox.Show("You are logged in as " + dt.Rows[i][3]);
if (comboBox1.SelectedIndex == 0)
{
admin ad = new admin();
ad.Show();
this.Hide();
}
else
{
frontdesk frontdesk = new frontdesk();
frontdesk.Show();
this.Hide();
}
}
}
}
else
{
MessageBox.Show("error");
}
Watch this video: ruclips.net/video/JGPhybZvdck/видео.html
is username is your primary key?
No, but you make it.
problem with sda.Fill(dt);
what's the error?
Send screenshot at facebook.com/TechSupportNep
I had same error and I had forgot to add 'con' variable in SqlCommand.
Example:
SqlCommand cmd = new SqlCommand("select * from Main_login where Username='"+txtuser.Text+"' and Password='"+txtpass.Text +"'",con);
Thanks bro
The provided source code link only contains adds 😠😠
click that like button, code will display!
Can you explain how I develop same login page in web application project
Great job!
Can you create it in java netbeans
ruclips.net/video/4IFvc7JOqtA/видео.html here it is :)
do you like our work?
does this tutorial help you?
if so, you can support us at www.patreon.com/RunCodes
Error in sda.Fill(dt);
what error did you get?
Exception unhandled
@@RunCodes same pls help
I messaged you on facebook just wondering if you could respond as I am having error every single time even if the right details. This would be great if u could message me back and we could fix this
Its great, Thanks
Thank so much!
2option of user is not login
??
thank you for helping us
Thankyou!!!!
thank you sir. subscribed
Лучший братан
It isn't working
what is error?
Dammi dai
Same in web application please...
Okey!
When you create video?? because I am creating a web application so can you help me...please
ruclips.net/video/Fu9ugKmxrzo/видео.html this is in php but if you want in asp.net follow the c#.net code! Whole code is same!
Thank you very very much sir...
in asp.net -> ruclips.net/video/Rnpb_OKuYAM/видео.html
thx bro
love
Exception unhandled
contact us at facebook.com/TechSupportNep
wowowow
WORK GREAT!!!
Check this new method!
How to Create a User Registration Form in C#.NET using SQL Server Database and Visual Studio 2022?
ruclips.net/video/TUKjALf7oOc/видео.html
Thank you
Amazing work. Thank you!!!!!