thx for the help amadeus

,i tried the following code :
Dim username as string, pass as string
username = frm_login.txt_name.Vallue
pass = frm_login.txt_pass.Value
placed it on a button named btn_login_click
it gives me the following error message :
"Reference to a non-shared member requires an object reference" (?)
and btw,that sql query command
"SELECT * FROM username_table WHERE username = 'username" & password = "password'"
where should i use it ? should i just "dim" a variable as sqlcommand ? (just guessing it up because it gives me a syntax error message).
sorry bout that,i'm new using this

and so grateful for your help.
ps.
could u recommend any reference book for this program ? (programmin vb.net and sql server and such)

.thx for the help !