Hi at all, i'm not a programmer, I used some asp code in the past using with dreamwaver.....
Now I'm approaching at vb.net, I've bought some ebooks, and starting to develop a small program.
Now I encounterd a problem in a code...
Created 1 form with 2 textbox (username, password)
I need to select a row in sql where the username is the same and get the value of ID column.
this is the code :
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Varsusr As String = NameTextBox.ToString
Dim Varpwd As String = PwdTextBox.ToString
Dim dbplug As New SqlClient.SqlConnection()
dbplug.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Gildo\Documents\Visual Studio 2012\Projects\DolphinBeta1\DolphinBeta1\bin\Debug\Dolphinbetadbase.mdf;Integrated Security=True;Connect Timeout=30"
Dim checkusr As New DataTable("userchecktable")
Dim qcheck As New SqlClient.SqlDataAdapter("Select id,name,lvl from utenti where name ='" & Varsusr & "'", dbplug)
dbplug.Open()
qcheck.Fill(checkusr)
dbplug.Close()
End Sub
How I can retrieve the value ID of the column?
Is the right way?, is the only
Sorry if seems a stupid question, but I need to start....
Now I'm approaching at vb.net, I've bought some ebooks, and starting to develop a small program.
Now I encounterd a problem in a code...
Created 1 form with 2 textbox (username, password)
I need to select a row in sql where the username is the same and get the value of ID column.
this is the code :
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Varsusr As String = NameTextBox.ToString
Dim Varpwd As String = PwdTextBox.ToString
Dim dbplug As New SqlClient.SqlConnection()
dbplug.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Gildo\Documents\Visual Studio 2012\Projects\DolphinBeta1\DolphinBeta1\bin\Debug\Dolphinbetadbase.mdf;Integrated Security=True;Connect Timeout=30"
Dim checkusr As New DataTable("userchecktable")
Dim qcheck As New SqlClient.SqlDataAdapter("Select id,name,lvl from utenti where name ='" & Varsusr & "'", dbplug)
dbplug.Open()
qcheck.Fill(checkusr)
dbplug.Close()
End Sub
How I can retrieve the value ID of the column?
Is the right way?, is the only
Sorry if seems a stupid question, but I need to start....