Non devi obbligatoriamente lavorare con dati sconnessi ( vedi dataset e company) , se ti serve una riga usa il tanto altrettanto potente ....:
Non passi tramite nessun dataset ma associ direttamene il valore della tua tabella all'oggetto che ti interessa nell'esempio una textboxcodice:Dim strID As String Try Cn = New OleDb.OleDbConnection(Stringaconnessionetuodb) Cn.Open() Cmd = New OleDb.OleDbCommand(TuaQuery, Cn) Dr = Cmd.ExecuteReader() ConsideraIndexChanged = False If Dr.Read() Then Txttuocampo.Text = Dr.Item("CampodellaTabella").ToString() End If Dr.Close() Cn.Close() Cmd.Dispose() Catch e As OleDb.OleDbException MsgBox(e.Message, MsgBoxStyle.Critical, "Errore accesso dati") Catch e As Exception MsgBox(e.Message, MsgBoxStyle.Critical, "Errore generale") End Try
![]()

Rispondi quotando