What's new

Closed Pa help po sa code vb.net

Status
Not open for further replies.

kingki

Addict
Joined
Jan 30, 2016
Posts
11
Reaction
4
Points
65
wala kasing nangyayari pag naglalagay ako ng number dun sa textbox ng RFID.. ang gusto ko sana palabasin ung mga info dun sa designated textbox. kahit di na po ako gagamit ng reader itype lang po sana namin ung RFID Number.

ayan po code ko sa ibaba.. thanks po sa tutulong



Imports System.Data.OleDb

Public Class Form2

Dim con As New OleDbConnection

Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
con.ConnectionString = "provider= microsoft.jet.oledb.4.0; data source = C:\Users\Admin\Documents\Databaseko.accdb"
con.Open()
End Sub

Private Sub showitems()
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter

da = New OleDbDataAdapter("Select * FROM Accounts WHERE RFID like '%" & txtRfid.Text & "%'", con)
da.Fill(dt)

txtCompany.Text = dt.Rows("RFID").Item(1)
txtAddress.Text = dt.Rows("RFID").Item(2)
txtCperson.Text = dt.Rows("RFID").Item(3)
txtCnumber.Text = dt.Rows("RFID").Item(4)
txtVuntil.Text = dt.Rows("RFID").Item(5)


End Sub
 
ang code na ginamit ko para sa inaalam mo ay ganito

txtCompany.Text = (rs.Fields(0).Value)
txtAddress.Text = (rs.Fields(1).Value)
And so on

yung rs.Fields 0 - ?? ay yung nasa Database mo
 
Status
Not open for further replies.
Back
Top