VBdotnet2005
asked on
retreived record
How can I retreive a record from txtMytransno.txt and load it into these textboxes? - Transactionnumber, Address, City, State, Zip and Repcomment. Below just fill Datagridview.
Dim StrConnection As String = "provider=microsoft.jet.ol edb.4.0;" + "data source = C:\Documents and Settings\CLIENT.SST_DOM\De sktop\XMAN \bad.mdb"
Dim Connection As New OleDbConnection(StrConnect ion)
Dim myCommand As New OleDbCommand("SELECT * FROM badtable where Transactionnumber = ' " & me.txtMytransno.txt & " ' ", Connection)
da.SelectCommand = myCommand
da.TableMappings.Add("Tabl e", "badtable")
Try
da.Fill(ds)
DataGridView1.DataSource = ds.Tables("badtable") ------ This is load on datagridview only
Catch ex As OperationAbortedException
MsgBox(ex.ToString)
End Try
Dim StrConnection As String = "provider=microsoft.jet.ol
Dim Connection As New OleDbConnection(StrConnect
Dim myCommand As New OleDbCommand("SELECT * FROM badtable where Transactionnumber = ' " & me.txtMytransno.txt & " ' ", Connection)
da.SelectCommand = myCommand
da.TableMappings.Add("Tabl
Try
da.Fill(ds)
DataGridView1.DataSource = ds.Tables("badtable") ------ This is load on datagridview only
Catch ex As OperationAbortedException
MsgBox(ex.ToString)
End Try
you need to bind the textboxes to the datagridview if i am understanding your question correctly
bind to ds..sorry...
ASKER
Infact I don't need datagridview at all. You can replace the code. I just want to retreive a record and fill textboxes - txtTransactionnumber.txt, txtAddress.txt , txtCity.txt, txtState,txt ,txtZip.txt and txtRepcomment.txt.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.