У нас вы можете посмотреть бесплатно C# login system with sql database или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
This article is about “Login system in C# with SQL Database”. 1. You first have to create sql database on sql server.I have created a database named “users” and in that table I have created a table called “login”. 2. Now, you have to insert some dummy data to test this application. I have added only 2 users , Syeda with password Syeda and admin with password admin. 3. Now , you have to create a project in Visual Studio 4. Create Basic form Design , as I have created using only textboxes , labels and panels with only 2 buttons one to login and other to exit the application 5. Now , I am writing basic code first that is the code for Exit button 6. Double click on the button , place to code will be opened 7. Now write Application.Exit(); 8. Save project and run 9. Now click on exit button application will exit 10. Now code for login 11. Here, you have to access database and search and march credentials using database query Code is : SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-R5KJ61R\SYEDA;Initial Catalog=users;Integrated Security=True"); SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From login where username='"+ textBox4.Text + "' and password='"+ textBox3.Text+"' ",con); DataTable dt = new DataTable(); sda.Fill(dt); if(dt.Rows[0][0].ToString()=="1") { MessageBox.Show( "Login successfully", "Login Message", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); } else { MessageBox.Show("Cridentials do not match", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } 12. First we have connected our db using connection string , to get this ,right click on db name and select properties in that panel you will get connection string 13. Now we have used sql adapters to file our query to check both username and password 14. Now if result of count is 1 it means user exists here as while inserting database no two users will have same username , so username will be unique 15. Then simply display a successful or error message based on the result Note: To hide password you can use System char Follow us On: / alprogramming