Programación visual studio 2008 O 2010
Soy nuevo programando con visual studio 2010 o 2008 quiero realizar una consulta sql con una base de datos acces y que me devuelva una respuesta
dim conexion as oledbconnection
dim sql_Adaptador As oledbdataadapter
dim dataset1 as dataSet
dim comando as oledbcommand
dim cnn as new oledb.oledbconnection
dim value as string = ""
dim result As boolean
result = false
dim connstring as string = "provider=microsoft.ace.oledb.12.0;" & _
"data Source=" + datadir + ";"
conexion = openconnection(connString, 2)
comando = new oledbCommand
with comando
.connection = conexion
.commandText = "select count (*) as contador from usuario where codigo=" me.txtcodigo.text
.commandType = commandType.Text
end with
sql_Adaptador = new oledbdataadapter(comando)
dataset1 = new dataset
sql_Adaptador.Fill(dataset1, "usuario.contador")
if dataset1.tables("usuario").rows.count > 0 then
result = true
end if
Esta programación me da error
dim conexion as oledbconnection
dim sql_Adaptador As oledbdataadapter
dim dataset1 as dataSet
dim comando as oledbcommand
dim cnn as new oledb.oledbconnection
dim value as string = ""
dim result As boolean
result = false
dim connstring as string = "provider=microsoft.ace.oledb.12.0;" & _
"data Source=" + datadir + ";"
conexion = openconnection(connString, 2)
comando = new oledbCommand
with comando
.connection = conexion
.commandText = "select count (*) as contador from usuario where codigo=" me.txtcodigo.text
.commandType = commandType.Text
end with
sql_Adaptador = new oledbdataadapter(comando)
dataset1 = new dataset
sql_Adaptador.Fill(dataset1, "usuario.contador")
if dataset1.tables("usuario").rows.count > 0 then
result = true
end if
Esta programación me da error
1 Respuesta
Respuesta de eligiomor
1