Hello, i try to develop some application for inventory and transaction using VB.Net with database access
i have a problem with query result, it looks like not using newest database when application already run.
for example :
i have MS access table like this
ID CustomerName
1 John
2 Doe
then i run my application and do search by ID, then i add new row directly using MS access to the table
3 John Doe
then i search ID = 3 , the result is not found. Help me please , thanks
Here is my codes.
Public Sub ConnOpen()
conn = New OleDb.OleDbConnection
conn.ConnectionString = dbProvider & dbSource
conn.Open()
End Sub
Public Sub ConnClose()
conn.Close()
End Sub
Public Function GetData(query As String, tbl As String)
ConnOpen()
Dim da = New OleDb.OleDbDataAdapter(query, conn)
Dim ds As New DataSet
da.Fill(ds, tbl)
ConnClose()
Return ds
End Function
Public Function FindBarang(vcode As String)
Dim query As String
query = "SELECT * FROM "
query &= "People "
query &= "WHERE ID = " & vcode
Dim data As DataSet = GetData(query, "FPeople")
Return data.Tables("FPeople").Rows
End Function