Errore nella lettura dal database access

giovedì 22 agosto 2013 - 12.24
Tag Elenco Tags  VB.NET  |  Visual Studio 2005  |  Access (.mdb)

gommosina Profilo | Junior Member

Dim CONTROLLA2 As New System.Data.OleDb.OleDbCommand() CONTROLLA2.Connection = con CONTROLLA2.CommandText = "select * from UTENTI WHERE USER='agenzia1' " Dim dr As System.Data.OleDb.OleDbDataReader dr = CONTROLLA2.ExecuteReader() 'Dim LEGGI2 As System.Data.OleDb.OleDbDataReader 'LEGGI2 = CONTROLLA2.ExecuteReader() 'Dim VEDI As Integer = LEGGI2 lbl_1.Text = dr("PERMESSO")

Quando eseguo questa query con access mi da il valore desiderato, mentre facendolo in vb net ottengo un messaggio che mi dice che non trova nessun valore per quella colonna..

Un piccolo aiutino grazie
dora

ridaria Profilo | Expert

> Dim CONTROLLA2 As New System.Data.OleDb.OleDbCommand()
> CONTROLLA2.Connection = con
>CONTROLLA2.CommandText = "select * from UTENTI WHERE USER='agenzia1'
>"
>
> Dim dr As System.Data.OleDb.OleDbDataReader
> dr = CONTROLLA2.ExecuteReader()
> 'Dim LEGGI2 As System.Data.OleDb.OleDbDataReader
> 'LEGGI2 = CONTROLLA2.ExecuteReader()
> 'Dim VEDI As Integer = LEGGI2
> lbl_1.Text = dr("PERMESSO")
>
>Quando eseguo questa query con access mi da il valore desiderato,
>mentre facendolo in vb net ottengo un messaggio che mi dice che
>non trova nessun valore per quella colonna..
>
>Un piccolo aiutino grazie
>dora

Innanzitutto manca: dr.read e poi a seguire:
lbl_1.Text = dr("PERMESSO")

Ciao Dora.

Fammi sapere e se è tutto OK chiudi il post cliccando su Accetta


Riccardo D'Aria

gommosina Profilo | Junior Member

mi dice ancora nessun dato esistente per riga/colonna
grazie
dora

gommosina Profilo | Junior Member

problema risolto
dora

ridaria Profilo | Expert

risolto? OK

CIAO
Riccardo D'Aria
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5