HomeОбразованиеRelated VideosMore From: Vetrivel D

Create Login Window in C# step by step

5834 ratings | 1847486 views
Link : http://www.csharpsteps.com This tutorials teach how to Create Login window with c# and sql server by won.Using c sharp programming, we create this login form. This is the best way to learn c# . Here Step by step learn ado.net concepts too.
Html code for embedding videos on your blog
Text Comments (996)
orhan can (5 days ago)
SqlConnection con = new SqlConnection(@"Data Source=.\orhancan\;Initial Catalog=ozben;Integrated Security=True"); SqlDataAdapter sda = new SqlDataAdapter("SELECT COUNT(*) FROM login WHERE kullanici_adi='" + usernametextBox1.Text + "' AND kullanici_sifre='" + passwordtextBox2.Text + "'", con); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") ((( i am getting the error here ))) { yetkili_frm frm1 = new yetkili_frm(); frm1.Show(); this.Hide(); } else MessageBox.Show("Tekrar Deneyin");
Arthur Deblaere (11 days ago)
Can someone help me with this error? "System.Data.SqlClient.SqlException: 'An attempt to attach an auto-named database for file C: \Users\arthu\Documents\School\Odisee\C#\C# Labo\Blok2\Oplossing Blok 2\Oplossing Blok 2\LoginDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share." Trows at the sda.Fill(dt); line
whenever i tried to create table my visual studio restarts
nojoud kaled (22 days ago)
Good
Dimbulana Kalyanawansa (26 days ago)
Thank you for your service.
Seshu Dodda (1 month ago)
Please give information about student management system using C#
Priya Patil (1 month ago)
🤔But how to create new user login..
Ace Espejo (1 month ago)
Big help thanks!
jahnavi duggisetty (1 month ago)
can we use ide for creating this forms and connect to sql
rajneesh chadhha (1 month ago)
goood
Behram Bayramli (1 month ago)
go to school kid
Omkar Gupta (1 month ago)
how to create a table by Ctrl+????
juli ali (1 month ago)
I have a project I making 20 table In sql server management studio But how to make front end of my every table please help....
im totally confuse on 8:50, when i turn on the translation it says Control Acid. -.-
Md Sabir (2 months ago)
Sir mai student verify k liye apne website me kch isi trh ka bnana chahta hu jisme ek inrollment no. Se stu ka detail dikhe aisa kch btaiye na sir please help me
Call Me Dan (2 months ago)
i got instance failure in sda
lal sena (2 months ago)
thank you sir.. i am sri lanka..
Adam Kuskoslav (2 months ago)
Cool stuff
Tewni (2 months ago)
login not works i dont get the login tab/page
Mint-O (2 months ago)
4:45 What does he mean by exit button
Mint-O (2 months ago)
dineth rukshan ooooh thx
dineth rukshan (2 months ago)
oh it will stop the running program and exit application also you can do this for an exit code \ application.Exit(); this is there so is a user wants to do something else rather logging in they can exit
Eric Appelgryn (2 months ago)
can you WhatsApp me +27 846644040
world peace (2 months ago)
In SQL server connection showing like this👇plz plz give solution what I have to do now: A network -related or instance-specific error occurred while establishing a connection to SQL Server .The server was not found or was access.Verify that the instance name is correct and that SQL Server configuration to allow remote connections.
Iuli Marius (2 months ago)
For errors: Change the ("Select count(*) From Id") it might be Id for someone not Username
Ahamed Riyaz (2 months ago)
What's the short cut key ctr + ?????
NIHAR NAVEEN (2 months ago)
IF U MEAN SHORTCUT TO SAVE THE TABLE THEN PRESS CTRL+S,AND THEN YOU CAN NAME THE TABLE, I DONT KNOW WHY PEOPLE ARE HAVING PROBLEM IN SAVING THE TABLE
sheshi kumar (3 months ago)
thank u and requesting to add more Vedio series
Tripix (3 months ago)
I press login and it does nothing at all. Please help.
rhaniel Jaboyanon (3 months ago)
THANK YOU!
Arslan Arif (3 months ago)
What you said at 8:51? What is short cut key?
NIHAR NAVEEN (2 months ago)
CTRL+S
Facebook Viral Vdeos (3 months ago)
how do i hide the password? like in ^ form?
NIHAR NAVEEN (2 months ago)
GO TO PROPERTIES OF TEXTBOX(PASSWORD),AND LOOK FOR PASSWORD CHAR...AND JUST TYPE ONE SINGLE * OR ^ OR WHATEVER YOU LIKE...MAKE SURE TO KEEP IT ONE AS CHAR ONLY KEEPS ONE BYTE.
Terance Edmonds (3 months ago)
Thank you soo much very helpful😉
Arslan Arif (3 months ago)
What he said at 8:51? What is short cut key?
dhbtaekhyung (3 months ago)
Hiii, I'm new here just learned how to use mysql in Visual Studio! I'm having troubles at the end~ Even when I entered the correct details as per stored in the database, the message box for error message appeared instead and does not open up the next form. Does anyone know how to fix this? Please help! T.T
FraznoFire (3 months ago)
gay
sport tv (3 months ago)
The data.mdf isn't saved in the database it wants to be saved in another file
Ankit Pal (3 months ago)
First of all thank you very much for this tutorial, now my question is from you that. Can i use connection string from web.config or app.config file as like web applications of c# for the windows application using c#
Arslan Arif (3 months ago)
What he said at 8:51? What is short cut key?
kv tuition centre (3 months ago)
Sir I want to how to make website by cording
sweety (3 months ago)
is there Any way u can help me out
sweety (3 months ago)
I am having problem with add connection to database
Toys Zone (3 months ago)
how do we register
JoshRC (3 months ago)
Hey I have got a problem, I copied the program to a folder at work that multiply people can access so that they could also use the application. I found that I can log in with no problem using my laptop but my other working mates cant log in using their laptops. it keeps saying something about not having an SQL server. I am not sure what to do to fix this because i want everyone to be able to use this application at work but no one seems to be able to log in apart from me.
i already have register how can i make it into logging in
babyma karthi (4 months ago)
bro i am diploma cse .net project ready pana poran .but i need for help.please reply me
Ashu Mohanty (4 months ago)
make more videos
Nadir Ali (4 months ago)
zabardast, thank you
Norhoda Paco (4 months ago)
i need you help
Norhoda Paco (4 months ago)
for my system
CrewlyPals (4 months ago)
doesnt work it logs in no matter what you type
Dinda Randina Abimayu (4 months ago)
nice tutorial. Do you have any video regarding insertion and retrieval of existing data set into new form from existing database? www.atmaluhur.ac.id
Bre4K (4 months ago)
if your wanna close application in form2("Main" is here), your can use form2 close event put inside Application.Exit();
Er en Fi lix (5 months ago)
con? sda? dt? ????
AYX AYo (5 months ago)
That mechanical keyboard sound is satisfying
AJTrap (5 months ago)
System.Data.SqlClient.SqlException: „Invalid object name 'Login'.” Plz help
Yuma Reynare (5 months ago)
He workd for me!
Fran M.E. (5 months ago)
Why can't I see Server Explorer on my window? Do I need a plugin or what?
Pidushi Upeksha (5 months ago)
After setting primary key what I want to do for change name as Login.
Pidushi Upeksha (5 months ago)
Its not clear.its look like Ctrl s
basant kumar Chandola (6 months ago)
I have a table (pay bill for 20 Employees with their user ID and Password).I want to login for each employee.How can this possible ?.Please help.
mukhlisin seba (6 months ago)
About This Invoice Tracker The Invoice Tracker is designed to maintain a history of customers, invoices, and invoice details so you can store multiple invoices without creating multiple files. You can also use the Invoice Tracker to analyze your previously invoiced data. For example, you can view all invoices for a customer, a specific project, or view all invoices for the last month, the last year, and more. Before you get started, take a look at the sample data provided. On the Invoice sheet, select the cell to the right of Invoice # (cell L8) and a drop down list will appear. Select the drop down arrow and then select a sample invoice. Notice how all of the invoice information automatically changes to reflect the selected invoice. Now look at the Customers, Invoices - Main, and Invoice Details sheets. Each of these sheets supply information to the Invoice and any changes you make will be updated automatically. How do I get started? Modify the Invoice sheet so it reflects your company information using the following steps: 1. Navigate to the Invoice sheet, and on the Review tab, in the Changes group, select Unprotect Sheet. Note: The Invoice sheet is protected to help avoid unintentional changes, since, as previously mentioned, the majority of the data on this sheet is pulled from all other sheets in the workbook. 2. Customize the invoice header by typing in your Company Name, Street Address, City, ST ZIP, email address, website, and so on. At the bottom of the invoice (row 43), modify the payment instructions. Important! Do not modify the billing or invoice information. All of these cells have formulas that will automatically update the invoice, as noted in the About the Invoice Tracker section. 3. (Optional) Modify the colors throughout the workbook: On the Page Layout tab, in the Themes group, select Colors and select another theme color set from the color gallery. Tip: Create a custom theme color set to match your company branding! To do so, on the Page Layout tab, in the Themes group, select Colors, and then select Create New Theme Colors. For more on creating a custom color set, view the following Help topic: Customize a document theme. 4. After you've made your desired changes, return to the Invoice sheet and on the Review tab, in the Changes group, select Protect Sheet, and then select OK. When the Invoice sheet is protected the only cell you can select is the cell with Invoice # drop down. How do I create an invoice? 1. On the Customers sheet, enter customer information such as the company name and address. Note that the Company # is an important entry as it provides a unique identifier for each company that is used throughout the Invoice Tracker. Also note you only need to add a company once. For subsequent invoices to the same company, this step can be skipped. Note: If you assign the same number to more than one Company or enter the same Company Name more than once, the entries will turn red to alert you to the duplication. 2. On the Invoices - Main sheet, enter the primary information for your invoice such as, Invoice #, Invoice Date, and Project Description. Like the Company #, the Invoice # is an important entry as it provides a unique identifier for each invoice and is used throughout the Invoice Tracker. Another important entry is the Company. When you select a company from the drop down provided it associates your invoice with that company. Then when you select an Invoice # on the Invoice sheet, that company's information, such as company name and address, will automatically be populated on the Invoice. Note: If you assign the same number to more than one Invoice the entries will turn red to alert you to the duplication. 3. On the Invoice Details sheet, enter the details for your invoice, such as an Item Description, Item #, Qty, and Unit Price. The Invoice # drop down provides a list of invoices you entered on the Invoices - Main sheet to facilitate data entry. Similar to the Company # in the previous step, the Invoice # associates that detail item with a specific invoice. When you select a Invoice # on the Invoice sheet from the Invoice # drop down, the related invoice detail items will appear for that invoice. Note: You are limited to 25 details items per invoice. If more than 25 items are added, all corresponding entries will turn red to alert you to this limitation. If you have more than 25 invoice items you will need to create a second invoice. How do I add more customers, invoices, and invoice details? The data for Customers, Invoices, and Invoice Details are stored in Excel tables. When you add a new row to a table, the newly added row will be formatted automatically and any calculations will be copied. To add new table rows do one of the following: ● If the table does not have a Total row, start typing below the table and it will automatically expand when you press the Enter or Tab key. ● Place your cell pointer in the last cell above the Total row, such in the Invoices table in the Notes cell for the last invoice, and then press Tab. ● On the Home tab, in the Cells group, select Insert, and then select Table Rows Above or Table Rows Below. ● In the bottom right corner of the table, place your mouse on the table sizing handle and drag down to increase the number of available table rows. How do I analyze my invoice details? As noted in the About the Invoice Tracker section, after you have entered several invoices you can view a list of all invoices for a specific customer, project, a specified date interval, and much more. This type of analysis is accomplished using a Filter which enables you to quickly narrow down a list of data. To access a Filter on the Customers, Invoices, or Invoice Details tables, select a drop down arrow next to any table field name. A Filter pane will display giving you a variety of filtering options. Here are a few filtering examples to help you get started: ● To view the total amount you've invoiced a specific customer: On the Invoices - Main sheet, to the right of the Company # field, select the drop down arrow. In the Filter pane, click Select All to deselect all companies, select the desired company, and then select OK. Tip: In the Filter pane you can also type the customer name in the Search text box to quickly search the available list. ● To view all invoices for a specific customer and specific project(s): Start by filtering for your desired customer using the steps provided in the previous example. Then, to the right of Project #, select the drop down arrow. In the Filter pane, select the desired project or projects, and then select OK. ● To view all invoices for the previous month: On the Invoices - Main sheet, to the right of the Invoice Date field, select the drop down arrow, point to Date Filters, and then select Last Month. ● To view all customers with the same area code: On the Customers sheet, to the right of the Phone field, select the drop down arrow. In the Filter pane, click in the Search text box, type the area code and then select OK. Filter Tips ● If a table has a total row, such as Customers and Invoices, the calculated totals will reflect only your filtered list. ● Use multiple filters on a single field or across multiple fields to fine-tune your results. ● To clear a single filter, select the drop down arrow for a previously filtered column and then select Clear Filter From <field name>. ● To clear multiple filters at the same time, place your cell pointer in the table, on the Home tab, in the Editing group, select Sort & Filter, and then select Clear.
Ravi kumar (6 months ago)
ser mera program run nhi ho rha error show kr rha h plz ser btao
information channel2015 (6 months ago)
https://www.youtube.com/watch?v=B1XTOMsy2ZQ
York Region Transit (6 months ago)
@"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename = "C:\Users\York Region Transit\Documents\testlogin.mdf"; Integrated Security = True; Connect Timeout = 30" there are some errors, how do i fix?
HyScript77 (6 months ago)
Control What! Idiot
farah zakaria (6 months ago)
ctrl+ ....... visual 2013
prashant rajput (6 months ago)
Which time use this language & sowtware learn Please tell me. i am beginner
doraemon kucing (6 months ago)
why i cannot change the table name?
Shonal Fernando (7 months ago)
Got stuck in 11:18 please help...
DalazyGamer12 (7 months ago)
can anyone help me with the code? this is it. using System.Data.SqlClient; namespace DgNeotech { public partial class Loginasadmin : Form { public Loginasadmin() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\*******\source\repos\*********\*********\PasswordData.mdf;Integrated Security=True;Connect Timeout=30;"); SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From Login where Username= '" + textBox1.Text + "' and Password= '" + textBox2.Text + "'" ,con); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { this.Hide(); Admin ss = new Admin(); ss.Show(); } else { MessageBox.Show("If you're just trying to guess the username and password, please stop. just. no."); } } } the asterics are to hide the info i dont want people to see. sorry.
SHAHNOOR ALAM (7 months ago)
Sir Visual Studio 2GB RAM System Supported Yes or No....
sandeep pal (7 months ago)
nice clip sir
lukas (7 months ago)
wow! thank you very much sir!
Waqas Maqbool (7 months ago)
Nice Project I love These project i also created like this . https://www.youtube.com/watch?v=zD03AOxTr_I
EnvyExploitz / EnvinalYT (7 months ago)
Ty I Made This For A Discord Server
John Boss (7 months ago)
Thank you everything just works just fine :) deserves a like 100%!!!
Yến Nguyễn (7 months ago)
thank you !
Jack Beale (7 months ago)
when i tried this i got a "System.Data.SqlClient.SqlException" on the sda.fill(dt) line of code :/ please help
måndag hela veckan (7 months ago)
I get this error when I try to login when in debug: System.Data.SqlClient.SqlException: 'Invalid object name 'Login'.' Does anybody know why this happens?
Cliff (7 months ago)
It works great for me, thanks a lot Vetrivel D
George Golea (7 months ago)
Thank you so much for the video.It helped me a lot.
Siddhant Jadhav (8 months ago)
textbox1.text there and error occuring in the .text. It is underlined in red. help!
RedoZ CXM (7 months ago)
have you gotten past the ctrl + ? part if so then help me !
Siddhant Jadhav (7 months ago)
[GD] oofgang tried didn't work.
RedoZ CXM (7 months ago)
textBox1.Text
Chua Quan (8 months ago)
Muốn xin đoạn code
Nadeeshani Nisansala (8 months ago)
hi
Mownabrata Dey (8 months ago)
Run PHP Code Online from Your Browser - https://www.runphp.online/
Dona Ferrell (8 months ago)
You are a lot of new things I need a scooby snacks for my check then back to work
Marlo Basas (8 months ago)
Thank you for this! This will help for those students that needs to learn while their professor didn't know how to explain some codes in their class! God bless! :-)
MD ADIL NADEEM (8 months ago)
i want login coading
Suriya Prakash (8 months ago)
Nice work bro Good effort Check out the link https://www.wikitechy.com/tutorials/csharp/
C.Vanlalfela chawhte (8 months ago)
Not working in my PC , How can i fix . ?
Optic Killer (8 months ago)
where the link of your tools pls give me
Souhila Susu (8 months ago)
a system of an entrance application to the gym
PixelVision X (8 months ago)
Thanks Bro for me everything works
Waqas Mustafa (8 months ago)
Hi nice work bro, I am now also going work on youtube channel. I am a graphics designer and will prepare lectures regarding tricks for the graphic.
Vinod Kumar (9 months ago)
How to edit server software
KeErThU (9 months ago)
i want login code for c# with oracle 10g pls
Andreas Morasch (9 months ago)
In Visual Studio 2017 your Code for SQLDataAdapter("Select Count(*) From Tablename Where.... does'nt work. Better do a "Select xyz From Tablename Where... in a database with one additional Column 'xyz'. Then the 'if' query has to be changed as follows: if (dt.Rows.Count == 1) There seems to be a problem in the SQL command comparing the content of the database with the values of the textboxes. Even changing the database fields into nvarchar (UTF8) doesn't help.
Tejas Rathod (9 months ago)
Why we use sqlconnection con=new sqlconnection.
Tejas Rathod (9 months ago)
What is con
Dafiedoe (9 months ago)
I got an error. It is: System.Data.SqlClient.SqlException: Invalid object name ‘Login’.
Sodoy Chakma (8 months ago)
me too
Ventylex Exploit (9 months ago)
the last } on line 40 is errored. and it says } expected but is already please help!
Ventylex Exploit (9 months ago)
Umm how do i make choose name pop up?
ari oviya (9 months ago)
hi i had a error in sda.Fill(dt); what to do? it also shows the invalid form name
Michał Majewski (9 months ago)
after i click Login i crash on line : sda.Fill(dt); System.Data.SqlClient.SqlException HResult=0x80131904 Message=Incorrect syntax near 'UserName'. Source=.Net SqlClient Data Provider Can you help?
John Smith (9 months ago)
What is "ss.SHOW" doing? You just breeze through things and dont explain a damn thing that our doing. Kinda pathetic.
John Dela Rosa (9 months ago)
C# Login page. SQL Server “ sda.Fill(dt); ” ERROR
ZoiBox (9 months ago)
You sound like a irs scammer

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.