Question:
How do I make a search 'engine' in VB.Net?
Fidget
2010-11-12 22:41:57 UTC
I want to use a textbox and button [unless there's an easier way] to create a search function in VB Express 2008.
The program is using OLE for a database file and I don't know how to make the button search the table for the text in the textbox. Also suggestions on what and how to display the results and also how they can be selected to be loaded from the database would be greatly appreciated!
Three answers:
Mit Chauhan
2010-11-13 04:56:51 UTC
JAI MATADI ..



well you said you want to search in the Table which you write in the TExtBox and u have used ACCESS CONNECTION . ..



its easy ..



you can use this code ..



------------------------------------------



i hope you know the basic connection code of .. how to connection ACCESS DATABASE in VB ..



i will give you the QUERY code ..

----------------------

dim qry as string

qry = "select * from your table name where yoursearchitem ='" & TextBoxid.Text & "'"

dim cmd as new oledbcommand(qry,conn)

dim da as new oledbdataAdapter(cmd)

dim ds as new data.dataset()

da.fill(ds,"table")

conn.close()

DataGridview1.datasource = ds.tables("table")

DataGridview1.DataBind();

-----------------------------------------------------------------



hope this helps .. good luck .. god bless ..



JAI MATADI ..
mccunn
2016-12-05 02:59:23 UTC
flow with java so as which you never "paint your self in a corner". Java promises internet, video games, multi-media, application purposes and cellular telephones apps on all computing gadget structures. receive the Netbeans 6.5 kit for JavaSE. Get the recent JavaFX plug-in and start up off doing state-of-the-paintings programming. VB, C, C++ will deliver not something yet grief with out any tangible effects until now 2 years have exceeded. Python? i like it and needed somebody might write a first rate widget library for Python. java already comes with buttons, abode windows, etc.
MEGAGIGABYTES
2010-11-12 22:57:23 UTC
First rule for programmers before he/she develops a software: UML design it.

so



+InitializeData() // Setup basic data allocations and declarations.

+checkForConnection()

+ListenForQuery() --> if available connect to DB and return results else

+closeConnection() ' while listening, keep connection closed to avoid eavesdropping.



----------------------------------------------------------------------------------------------

sub XXXX handles Form.OnStartup







end sub









-------------------------------------------------------------

Another class or module acting as a link between app and DB

---------------------------

private class dbLink



public sub dbLink(dbUrl: String, dbName: String, dbPort: Integer, dbUserName: String,dbPass: SecureString or String) as boolean

..

do stuff

......



end sub



end class


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...