How to Create Login Form using vb.net and SqlServer Database

preview_player
Показать описание
In this video, we'll see how to create a login form using VB.NET and SQLServer database
Рекомендации по теме
Комментарии
Автор

i was searching alot about this video, what ever i saw i was get problem, this video only worked with me thanks so much bro :)

AmrAlexandrin
Автор

exellent, finally i got the right solution for my project

siddheshchawan
Автор

I love the music on this!! But good post! This was my logic that I did. I thought there was some fancy secure way of doing it but I guess I was right!! I"m glad we think alike! Thanks for sharing!!

TechGuyChris
Автор

con.Open() is not working 
it says a SQL exception error

anscx
Автор

how do i fix this error

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Code:

Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim rd As SqlDataReader

con.ConnectionString = "Data Source=localhost; user=root; password=Doctorwho23; initial Catalog=User; integrated security=true"
cmd.Connection = con
con.Open()
cmd.CommandText = "select login, password from auth where login = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & "'"

rd = cmd.ExecuteReader
If rd.HasRows Then
Form2.Show()
Else
MessageBox.Show("Login and Password Incoreect")
End If

End Sub
End Class

NekoSuneVRBackup
Автор

how do i connect it to a database hosted on another webserver. For my website I want registered users to login to my program. How do i connect it to same database?

KCommunity
Автор

excellent.Finally i got answer. Can you help me how to retrieve database values in combobox 

snehapriya
Автор

I was hoping you will also teach how to make the database!!!

francheskafarr
Автор

dr= cmd .executereader is not working how to fix it ?

plzdiethnkzbie
Автор

nice video but could you make one showing you how you create a sql server database and connect it to the login form? PLEASE! :) that would help so many people

Jon
Автор

hey how you added database? I am not able to add database with this program.

snehalcreations
Автор

How does the generated EXE work on someone else's computer?

zxc
Автор

easy nice video.  love to tune what is it?

vinwhaay
Автор

is not accessible in this context because it is 'Friend'.
how to fix it?

it is on the dim dr as sqlDataReader
dr = cmd.executeReader.
why is it not working?

GlicerioCatolico
Автор

i am getting a null reference exception on the following line
con.ConnectionString = "data source= loacalhost; initial catalog= user; integrated security=true"

and form2 is not opening
please help me.

pintuadhikary
Автор

I keep getting an error, I can get the codes working to make it login, but once I type in the username and password and click login, an error message pops up saying this line of code is wrong con.ConnectionString = "Data Source=localhost; Initial Catalog=user; Integrated Security= true"

My SQL Server Database table is called Users and the database is called users.mdf

How can I fix this so that I can login and goto my 2nd form?

Jon
Автор

How to make it "INVALID USERNAME" if the Username is wrong? Same as Password. Thank you.

aegielofalla
Автор

cmd.CommandText = "select usename, password from users where usename = '"&first.text&"' and password = '"&second.text&"' "
this isnt working it ends the command text on username = "
help please

peterbousaada
Автор

Sub New(command As System.Data.SqlClient.SqlCommand, behavior As System.Data.CommandBehavior)' is not accessible in this context because it is

WHY? HOW TO DEBUG? :(

mauiimaurillo
Автор

i am getting a null reference on the following line"Data Source=localhost; Initial Catalog=user; Integrated Security =true"
any help

zeeshanqureshi