| | |
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 .net2008 2005 2008 access account arithmetic array basic beginner bing browser button buttons center check code combobox crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter forms ftp generatetags hardcopy html images input insert intel internet mobile monitor ms net networking objects open output panel passingparameters pdf picturebox picturebox1 port position printing problem project save searchvb.net select serial settings shutdown soap sqlserver survey tcp temperature text textbox timer timespan toolbox transparency trim update updown user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet view visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





