| | |
search code not working!!!
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2005
Posts: 17
Reputation:
Solved Threads: 0
any1 help, basically iv wrote the code to search for a client name in a database(in access) and this is the code: but it underlines the "OleDbDataAdapter1" in the but i dont know why as that is what my dataAdapter is called??
please help, id be very grateful!!!!!
•
•
•
•
Private Sub BtnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'search
If txtSearch.Text = "" Then MsgBox("Please type Client Name", MsgBoxStyle.Critical, "Enter Text") : Exit Sub
Dim MYDA As OleDbDataAdapter1 = New OleDbDataAdapter()
Dim MYDS As DataSet = New DataSet()
RS = New ADODB.Recordset()
RS.Open("SELECT * FROM CLIENT WHERE NAME LIKE '" & txtSearch.Text & "%' ", CN, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
MYDA.Fill(MYDS, RS, "NAME")
DataGrid1.DataSource = MYDS.Tables(0)
End Sub
End Class
•
•
•
•
Dim MYDA As OleDbDataAdapter1 =. .......
please help, id be very grateful!!!!!
Last edited by shelly121; Mar 1st, 2005 at 10:49 am. Reason: mistype
•
•
Join Date: Mar 2005
Posts: 65
Reputation:
Solved Threads: 0
Try adding these imports statements at the top before anything else:
Imports System()
Imports System.Data()
Imports System.Data.Oledb()
If you do not add those imports statements, then when you declare your dataadapter you will have to do something like this:
Dim MYDA As System.Data.Oledb.OleDbDataAdapter1 = New OleDbDataAdapter()
Chester
Imports System()
Imports System.Data()
Imports System.Data.Oledb()
If you do not add those imports statements, then when you declare your dataadapter you will have to do something like this:
Dim MYDA As System.Data.Oledb.OleDbDataAdapter1 = New OleDbDataAdapter()
Chester
•
•
Join Date: Mar 2009
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
any1 help, basically iv wrote the code to search for a client name in a database(in access) and this is the code:
but it underlines the "OleDbDataAdapter1" in the but i dont know why as that is what my dataAdapter is called??
please help, id be very grateful!!!!!
in your adodc properties, find the tab that contains the cmdunknown, i can't remember exactly where that place is...
then check SQl and type:
Select * from (name of table of the database)
ex Select * from emp
this makes the form connected to the database...
then create a textbox which you will input the search word
next, create a search command button...
type this command to be executed...
"Select * from (name of table) where (name of data to be seached eg. REG_NO) like '" & txtSEARCH.Text & "%" & "'"
this makes the program search the word which contains the words or letters that is in the text box...
i hope i helped you...
![]() |
Similar Threads
- Search code in a database (Visual Basic 4 / 5 / 6)
- CHECKBOX VAILDATION CODE not working (PHP)
- ADODC Search code (Visual Basic 4 / 5 / 6)
- I would liike to multiply two matrices but my code is not working..help me out! (C++)
- Can some one help me with this code plz (Visual Basic 4 / 5 / 6)
- search bar not working (Windows NT / 2000 / XP)
Other Threads in the VB.NET Forum
- Previous Thread: Plese Help me in Threading
- Next Thread: locating remote machine name
| Thread Tools | Search this Thread |
.net 2005 2008 access account arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





