Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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
0
VBdotnet2005
Asked:
VBdotnet2005
  • 3
1 Solution
 
razorback041Commented:
you need to bind the textboxes to the datagridview if i am understanding your question correctly
0
 
razorback041Commented:
bind to ds..sorry...
0
 
VBdotnet2005Author Commented:
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.
0
 
razorback041Commented:
http://www.startvbdotnet.com/ado/simplebinding1.aspx
that should be all the info you need.  gl
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now