I need to load a specific data into a variable in VisualBasic but im having this probably and getting a bit frustrated with this error. I would really aprecciate any help.
Dim conn As New SqlConnection("Data Source=LUCIFERI\SQLEXPR2012;Initial Catalog=ProyectoBD;Integrated Security=True; Connection Lifetime=60; Max Pool Size=50; Min Pool Size=3")
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
Dim ds As New DataSet
cmd.Connection = conn
cmd.CommandText = "SELECT idPerfil FROM USUARIO WHERE USUARIO.correoElectronico =" & emailtxt.Text
conn.Open()
dr = cmd.ExecuteReader()
ds.EnforceConstraints = False
dts.gtipo = Convert.ToString(dr.Item("idPerfil"))
dr.Close()