Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

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.oledb.4.0;" + "data source = C:\Documents and Settings\CLIENT.SST_DOM\Desktop\XMAN\bad.mdb"

Dim Connection As New OleDbConnection(StrConnection)

Dim myCommand As New OleDbCommand("SELECT * FROM badtable where Transactionnumber = ' " & me.txtMytransno.txt & " ' ", Connection)

da.SelectCommand = myCommand

da.TableMappings.Add("Table", "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
Avatar of razorback041
razorback041
Flag of United States of America image

you need to bind the textboxes to the datagridview if i am understanding your question correctly
bind to ds..sorry...
Avatar of VBdotnet2005

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
Avatar of razorback041
razorback041
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial