How to Create Login Page in Asp.Net With Sql DataBase

  Рет қаралды 274,660

CodAffection

CodAffection

7 жыл бұрын

How to Create Login and Logout Page in Asp.net using SQL server database.
The tutorial discusses the following points :
- Create Login Page in asp.net webform
- Logout in Dashboard( Home Page)
Login-Logout System(user authentication) is implemented using a session.
📂 GitHub Repository
► goo.gl/24sG2F
💖 Buy me a Coffee
➤ bit.ly/3L36ut4 (PayPal)
➤ bit.ly/3VF0iPT (Razorpay)
🌀 Related Videos
goo.gl/ySUFf8 : Similar Mvc Tutorials
goo.gl/3ajHuA : Similar C# Video Tutorials
goo.gl/yHZcCo : Build Complete Asp.Net MVC App
goo.gl/ZXKqT9 : jQuery Ajax in Asp.net MVC
🔗 Find me in
Udemy : bit.ly/3RtyQSB
Facebook : / codaffection
GitHub : github.com/codaffection
Discord : / discord
Twitter : / codaffection
#AspNet #CodAffection

Пікірлер: 148
@CodAffection
@CodAffection 7 жыл бұрын
goo.gl/RFY5C2 : Subscribe to CodAffection goo.gl/PnEc6c : User Sign Up Or Registration in Asp.Net goo.gl/oxDoDK : Asp.Net CRUD Operations goo.gl/UoNfs4 : Asp.Net Grid Inline CRUD
@kevinrodrigues8809
@kevinrodrigues8809 3 жыл бұрын
I've seen thousands of videos, and yours is the only one that helped me, thanks (google translate)
@knit800
@knit800 5 жыл бұрын
Thank you for doing this. Great job, sir!
@nidhikhare8331
@nidhikhare8331 4 жыл бұрын
Thanks sir, aapne bahut hi simple taraikee se btaya .... Thanks for helping me
@diablowizard457
@diablowizard457 5 жыл бұрын
Exactly what I was looking for! Thank you so much!
@CodAffection
@CodAffection 5 жыл бұрын
Glad you found the video helpful.
@vitaliisharapov8866
@vitaliisharapov8866 4 жыл бұрын
MAN!!! THANK YOU VERY MUCH!! This is just miracle!!! Could you please post more videos about ASP.NET Webforms?
@marcoscabrera96
@marcoscabrera96 6 жыл бұрын
Thanks bro!!! Great tutorial :D
@ayrtonaranibar3622
@ayrtonaranibar3622 3 жыл бұрын
Muchas gracias papu, me ha servido muchisimo, mis respetos :3
@Buzca
@Buzca 3 жыл бұрын
I love your videos. Thank you!
@danielortiz1347
@danielortiz1347 4 жыл бұрын
Thank you very much. Just what i'm looking for
@lectiionline6907
@lectiionline6907 3 жыл бұрын
Thank you for your help and your explanations!
@akshaygade5182
@akshaygade5182 6 жыл бұрын
awesome job sir,very helpful
@mohammadyasin999
@mohammadyasin999 6 жыл бұрын
thanks, i found this video very useful. nice and simple.
@kammistry165
@kammistry165 4 жыл бұрын
Works! thanks! ... Other published methods on the net failed: employed disabling of anonymous users, but by doing so, login page was also not allowed on 2019 visual studio.
@meryemer-raki4560
@meryemer-raki4560 6 жыл бұрын
Excellent ! thanks !
@Miguel-gm9hx
@Miguel-gm9hx 6 жыл бұрын
Thank you very much! You solved all the problems for my school project!!
@CodAffection
@CodAffection 6 жыл бұрын
You are welcome.
@BreadSTickist
@BreadSTickist 4 жыл бұрын
Yes me too
@Roika_77
@Roika_77 5 жыл бұрын
Sir, may I ask if Session["username"] can be any name? Or is there id called username to use Session?
@kennethbomholdt3433
@kennethbomholdt3433 6 жыл бұрын
Thanks a lot, this was very helpful to me :-)
@CodAffection
@CodAffection 6 жыл бұрын
I'm glad you fount the video helpful.
@dylmatYT
@dylmatYT 5 жыл бұрын
This was great help! Thank you :)
@CodAffection
@CodAffection 5 жыл бұрын
you are welcome. let me know if you have any video suggestion regarding asp.net.
@grumpymeercat
@grumpymeercat 6 жыл бұрын
Thank you very much!
@canand6786
@canand6786 6 жыл бұрын
Thanks, Very useful
@sqwertysqwerty8988
@sqwertysqwerty8988 3 жыл бұрын
Thenk u! Thenk U! it worked now I can add more features
@akshaygade5182
@akshaygade5182 6 жыл бұрын
what if i have to retrieve only certain database....like for Admin to redirect to another page??
@Cr3x2p
@Cr3x2p 5 жыл бұрын
thanks you so much sir!
@maryemtarhri1482
@maryemtarhri1482 7 жыл бұрын
your course is soooo helful ..... thank you so so much
@CodAffection
@CodAffection 7 жыл бұрын
thanks for the support
@NVAKAYAMINI
@NVAKAYAMINI 2 жыл бұрын
Excellent work . It is very helpful for me
@abhishekyadav-hn1gf
@abhishekyadav-hn1gf 2 жыл бұрын
Thanks a lot, successfully completed my page
@user-wf9pq2ee1y
@user-wf9pq2ee1y 6 жыл бұрын
Dear Sir, I follow the scenario and the web works properly. But, if I input the incorrect account which is not existed in the database, the login goes wrong. How to solve this symptom? (The "Authorize" Action should be modified! I guess.)
@capitald9482
@capitald9482 3 жыл бұрын
keep going bro thx
@Solly_Bopape_01
@Solly_Bopape_01 2 жыл бұрын
Best coding channel🔥👌
@cameron1988
@cameron1988 6 жыл бұрын
Great Tutorial!
@CodAffection
@CodAffection 6 жыл бұрын
Thanks for the comment
@kavitasharma-yr2gc
@kavitasharma-yr2gc 11 ай бұрын
Hi sir, plz guide why u type cast to execute scalar method
@a.s.8113
@a.s.8113 4 жыл бұрын
Very Helpful
@gohilnayanaba4831
@gohilnayanaba4831 4 жыл бұрын
sir your video is very helpful for me
@HlawulaniMaluleke-lg6mw
@HlawulaniMaluleke-lg6mw 10 ай бұрын
Thanks for video
@omarnajmi6683
@omarnajmi6683 3 жыл бұрын
Thank you very much
@newjsan
@newjsan 6 жыл бұрын
Well done. Thank you.
@CodAffection
@CodAffection 6 жыл бұрын
Thanks man.
@theresioleefland1737
@theresioleefland1737 4 жыл бұрын
hey guys ive done everything just the same, but when i open my login page in google and fill in the credentials to login i get this error in my visual studio 2019 : System.ArgumentException: 'Invalid value for key 'integrated security'.' therefore i cant get trough the login page
@ravikantha1
@ravikantha1 3 жыл бұрын
Thank you very much.
@deathhackers6183
@deathhackers6183 3 жыл бұрын
Great you help me so much
@ingjb87
@ingjb87 6 жыл бұрын
Great our Job, What If I want to create a Connection Class and then call the Process in each page where I Need to Execute an SQL query?
@olugbenrosamuel
@olugbenrosamuel 4 жыл бұрын
Thank you so much
@aniketshetty2721
@aniketshetty2721 5 жыл бұрын
Thank you soo much.. god bless
@CodAffection
@CodAffection 5 жыл бұрын
Thank you.
@happiestmeinworld
@happiestmeinworld 5 жыл бұрын
Can u add a video like after login page...showing the user details.on that page we edit the details like that.
@SardiusSriver
@SardiusSriver 4 жыл бұрын
Hi, thanks for your tutorial ! Do you have any videos about login modules with encrypt password ?
@noyou2353
@noyou2353 5 жыл бұрын
Thank you sir ..helps alot for beginners
@CodAffection
@CodAffection 5 жыл бұрын
you are welcome. let me know if you have any asp.net related topic suggestion for future videos.
@shahidouahdi3814
@shahidouahdi3814 4 жыл бұрын
I have a quick question. so if I enter the url " .../Dashboard.aspx" directly in my navigator, it will still ask for a username and password ? or i would be able to access the page with no problemes ?
@youtubefan899
@youtubefan899 5 жыл бұрын
Thank you Sir
@evantan6326
@evantan6326 6 жыл бұрын
How to export this SQL database to CSV? Can you do a tutorial of it?
@mohsin6312
@mohsin6312 5 жыл бұрын
Many many thanks for your amazing tutorial.
@knowiz8071
@knowiz8071 5 жыл бұрын
Watch other tutorials this is out dated and considered bad practice nowadays.
@mohsin6312
@mohsin6312 5 жыл бұрын
@@knowiz8071 I needed this for my University assignment.
@faiqkhan5911
@faiqkhan5911 2 жыл бұрын
package konsa selct kiya tha project create karteh watq
@danielquek329
@danielquek329 4 жыл бұрын
Hi, for my project, it keep ahowing error and pointing to the sqlCon.Open(), any solution for me😭
@yiush7868
@yiush7868 3 жыл бұрын
im trying to resolve the issue with this too.. its something to do with the data source..
@sistemasfischer5958
@sistemasfischer5958 3 жыл бұрын
Great video
@donamritpal
@donamritpal 4 жыл бұрын
A big Thanks
@MultiToblo
@MultiToblo 6 жыл бұрын
Best voice of the youtube!
@CodAffection
@CodAffection 6 жыл бұрын
Thank you for the wonderful feedback! :) I'm humbled.
@anusreev6732
@anusreev6732 3 жыл бұрын
Thank you
@mrsuiii2998
@mrsuiii2998 5 жыл бұрын
Thank you.
@wihandebeer1755
@wihandebeer1755 5 жыл бұрын
LEGEND
@BreadSTickist
@BreadSTickist 4 жыл бұрын
You helped me again. Thank you from my heart
@CodAffection
@CodAffection 4 жыл бұрын
you are welcome.
@dadasajad8741
@dadasajad8741 4 жыл бұрын
Thank you dear. very much helpful
@CodAffection
@CodAffection 4 жыл бұрын
My pleasure 😊
@bhauminpatel2662
@bhauminpatel2662 5 жыл бұрын
Great view
@healthnspice1376
@healthnspice1376 4 жыл бұрын
i am getting an error like : " object reference not set to an instance of an object.'" near " lblErrorMessage.Visible = false; " help me with this
@vashirasamaila6317
@vashirasamaila6317 5 жыл бұрын
Thank you so much.
@knowiz8071
@knowiz8071 5 жыл бұрын
Watch other tutorials this is out dated and considered bad practice nowadays.
@yiush7868
@yiush7868 3 жыл бұрын
Hey i know this is a long-ago video but do you have a registration and forget password tutorial
@NidhiSharma-pt5ze
@NidhiSharma-pt5ze 4 жыл бұрын
there is an error in int count = Convert.ToInt32(sqlCmd.ExecuteScalar());
@jaynostulop2476
@jaynostulop2476 3 жыл бұрын
Hello, need assistance on lblerrormessage.visible = false;. Why its still showing up even if it is on page load
@somajahnavi7861
@somajahnavi7861 3 жыл бұрын
I'm getting an error as invalid object name 'userDetails' in the execution time and at the line of int count=Convert.ToInt32(cmdExecuteScalar()); Can anyone please help.....
@sametcesmebasi9568
@sametcesmebasi9568 2 жыл бұрын
up
@navjotsingh2457
@navjotsingh2457 3 жыл бұрын
TY
@rahibridoy6229
@rahibridoy6229 Жыл бұрын
boss you are the best
@CodAffection
@CodAffection Жыл бұрын
thank you.
@barenecessities5354
@barenecessities5354 3 жыл бұрын
Thank you for sharing this! Very informative. However I see that while using this query, the password can be CAPS or small letters, and it will still permit user login unless the database table tblUser has collation set to be case sensitive.
@CodAffection
@CodAffection 3 жыл бұрын
Good point!
@waseemsiddique9715
@waseemsiddique9715 2 жыл бұрын
Nice video bro but plz show output also after some steps it will help u understand... 👍
@ravimeher6067
@ravimeher6067 6 жыл бұрын
I am getting error as System.InvalidOperationException: 'ExecuteScalar: Connection property has not been initialized.' plz help
@BreadSTickist
@BreadSTickist 4 жыл бұрын
Try to add this line in top of Login.aspx.cs using System.Data.SqlClient;
@arabindapatra5665
@arabindapatra5665 4 жыл бұрын
I am getting an error message in lblUserDetails
@andregomezmercado1183
@andregomezmercado1183 5 жыл бұрын
This videos s god-like!
@CodAffection
@CodAffection 5 жыл бұрын
Glad you found the video helpful.
@avocadomangos
@avocadomangos 5 жыл бұрын
Thanks
@Animated-Corporate-Videos
@Animated-Corporate-Videos 5 жыл бұрын
Hi, How are bro? I have a question for you, I have VB.net windows form application with MYSQL database. Is it possible to connect Firebase Database instead of SQL server with VB.NET desktop application?
@justboughtmarmalade628
@justboughtmarmalade628 5 жыл бұрын
thats visual basic LOL
@ishmaelkhattab4020
@ishmaelkhattab4020 3 жыл бұрын
T H A N K S ! ! !
@davidmaceda5379
@davidmaceda5379 6 жыл бұрын
excellent tutorial
@CodAffection
@CodAffection 6 жыл бұрын
thank you :)
@planetcamo5829
@planetcamo5829 2 жыл бұрын
Where do you get the @Data Source line from? (7:30 in the video)
@CodAffection
@CodAffection 2 жыл бұрын
Answer is here : stackoverflow.com/a/4879175/4133590
@acmevisit
@acmevisit 4 жыл бұрын
Nice
@Amirajama
@Amirajama 3 жыл бұрын
I'm having problem in SQL part like...you didn't explain that part so well and I'm confuse af... how the table was ready and everything ?
@mikestevens1718
@mikestevens1718 6 жыл бұрын
When I right-click - properties on the btnLogin and double-click the Click event, I do not get a Login.asps.c page to edit the code. I am getting a Login.aspx.vb page. What am I doing wrong? If I click on Design I see the page correctly. I am just not getting the right page to add the click event code.
@CodAffection
@CodAffection 6 жыл бұрын
so you are working on VB.Net
@mikestevens1718
@mikestevens1718 6 жыл бұрын
I am working (practice) on Asp.Net
@andrewnleon
@andrewnleon 4 жыл бұрын
Hi, do you have a method of encrypting the password or is your method secure enough?
@syedwasay3087
@syedwasay3087 4 жыл бұрын
the method isnt secure for encryption use authentication and security classes they are a bit complex but most secure
@andrewnleon
@andrewnleon 4 жыл бұрын
@@syedwasay3087 i plan to use sha1 on submit login and register. this would be an accurate approach?
@faruksmajlovic6773
@faruksmajlovic6773 4 жыл бұрын
I used MD5 once worked like a charm, it is really easy to implement too.
@andrewnleon
@andrewnleon 4 жыл бұрын
@@faruksmajlovic6773 ty for your feedback
@AnuragSharma-jx8df
@AnuragSharma-jx8df 6 жыл бұрын
Hello if u could upload a similar video of login according to various roles then it would be a big help
@CodAffection
@CodAffection 6 жыл бұрын
I'll see what I can do!
@ahmedrashed5567
@ahmedrashed5567 7 жыл бұрын
thanks
@CodAffection
@CodAffection 7 жыл бұрын
you are welcome.
@abineshgopal1906
@abineshgopal1906 5 жыл бұрын
int count = Convert.ToInt64(SqlCmd.ExecuteScalar()); this line error will be occur.how to modify line
@CodAffection
@CodAffection 5 жыл бұрын
check you db connection string or try with break point.
@abineshgopal1906
@abineshgopal1906 5 жыл бұрын
CodAffection tq.
@ahmedrashed5567
@ahmedrashed5567 7 жыл бұрын
I try to use sspi connection it works good on my machine but get this error on anthers machine in domain Server Error in '/' Application application error from being viewed remotely (for security reasons) I search a lot but get nothing hope ur help if u don't mind
@CodAffection
@CodAffection 7 жыл бұрын
Check your DB Connection String.
@ahmedrashed5567
@ahmedrashed5567 7 жыл бұрын
thanks so much for the reply - but DB connection string i guess it right coz it works well on my machine - db server is not my machine just website and iis on my machine -
@CodAffection
@CodAffection 7 жыл бұрын
db is in another server machine right ?
@ahmedrashed5567
@ahmedrashed5567 7 жыл бұрын
yes sir - we work on domain - theirs machine have db and my machine have website and there others
@CodAffection
@CodAffection 7 жыл бұрын
can you connect server db from your local machine using ssms or visual studio?
@darkclouds98
@darkclouds98 3 жыл бұрын
HI bro, how do you hide the password? cuz your video shows the password
@akshaygade5182
@akshaygade5182 6 жыл бұрын
i am having problem in {int count = Convert.ToInt32(sqlcmd.ExecuteScalar()); } showing No mapping exists from object type System.Web.UI.HtmlControls.HtmlInputPassword to a known managed provider native type. plz help
@CodAffection
@CodAffection 6 жыл бұрын
particular stored procedure should return integer string
@akshaygade5182
@akshaygade5182 6 жыл бұрын
done sir
@omkarlele693
@omkarlele693 7 жыл бұрын
Hi I am beginner and have NO knowledge of ASP.NET I viewed the video and followed the steps. However when clicked on login, got below error. Please help me here. Error: Server Error in '/' Application. ExecuteScalar requires an open and available Connection. The connection's current state is closed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: ExecuteScalar requires an open and available Connection. The connection's current state is closed. Source Error: Line 25: sqlcmd.Parameters.AddWithValue("@Username", txtUserName.Text.Trim()); Line 26: sqlcmd.Parameters.AddWithValue("@Password", txtPassword.Text.Trim()); Line 27: int count = Convert.ToInt32(sqlcmd.ExecuteScalar()); Line 28: if (count == 1) Line 29: { Source File: Q:\Prod\myproject\loginpage\loginpage\login.aspx.cs Line: 27 Stack Trace: [InvalidOperationException: ExecuteScalar requires an open and available Connection. The connection's current state is closed.] System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +2378748 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +91 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53 System.Data.SqlClient.SqlCommand.ExecuteScalar() +180 loginpage.WebForm1.btnlogin_Click(Object sender, EventArgs e) in Q:\Prod\myproject\loginpage\loginpage\login.aspx.cs:27 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9659822 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0
@CodAffection
@CodAffection 7 жыл бұрын
Please Check Your Sql Server Connection String
@omkarlele693
@omkarlele693 7 жыл бұрын
Sir, It is exactly same as provided by you. as below: using (SqlConnection SqlCon = new SqlConnection(@"Data Source=(local)sqle2012;initial catalog=LoginDB;integrated security=true;")) { string query = "SELECT COUNT(1) FROM People WHERE UserName=@username AND Password=@password"; SqlCommand sqlcmd = new SqlCommand(query, SqlCon); sqlcmd.Parameters.AddWithValue("@Username", txtUserName.Text.Trim()); sqlcmd.Parameters.AddWithValue("@Password", txtPassword.Text.Trim()); int count = Convert.ToInt32(sqlcmd.ExecuteScalar()); if (count == 1) { Session["Username"] = txtUserName.Text.Trim(); Response.Redirect("Dashboard.aspx"); } else { lblErrorMessage.Visible = true; } }
@CodAffection
@CodAffection 7 жыл бұрын
Did you create the Sql Server DataBase LoginDB in Your System ?
@omkarlele693
@omkarlele693 7 жыл бұрын
yes SQLEXPRESS.LoginDB
@CodAffection
@CodAffection 7 жыл бұрын
do you know the sql server instance name ?
@default632
@default632 4 жыл бұрын
YOUR NAME IS SHAMZU, DATABASE SERVER DONT LIE
@CodAffection
@CodAffection 4 жыл бұрын
:)
@default632
@default632 4 жыл бұрын
@@CodAffection Happy day to you, I am so lucky to be noticed.
@fahimehporbarzegary3325
@fahimehporbarzegary3325 4 жыл бұрын
Thanks
@foootyflickss
@foootyflickss 5 жыл бұрын
TY
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 69 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 37 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 105 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
Asp.Net Core Web API CRUD Operations Using EF Core and SQL Server
49:55
Node.js RESTful API CRUD with Express & MongoDB
47:52
CodAffection
Рет қаралды 19 М.
HTML Tutorial for Beginners
39:06
Kevin Stratvert
Рет қаралды 613 М.
SQL Day 3: How to Practice SQL Queries?
41:23
Janardhan Reddy Bandi
Рет қаралды 22 М.
SQL Server Programming Part 1 - Stored Procedure Basics
10:31
WiseOwlTutorials
Рет қаралды 490 М.
ASP.NET Tutorial 3- How to Create a Login website - Creating Database For website
13:42
SQL Tutorial for Beginners [Full Course]
3:10:19
Programming with Mosh
Рет қаралды 11 МЛН
What is the use of JavaScript in ASP NET
14:30
kudvenkat
Рет қаралды 780 М.
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 69 МЛН