-
March 2nd, 2010, 06:09 AM
#1
vb.net, Adodc.recordsource, Sql Search Problem
Friends I have Developed my Data base Project on vb6, using adodc and datagrid using ms access database file, it was working nice in vb6, I also put Search box there and used adodc1.recordsource="select * from table" sql query.
later i needed to convert it in vb.net
I converted it, every thing is working fine, but one problem appears, an adodc's Recordsource query for searching records is not working, it only works if there is data in dataset (Datagrid),
suppose once i pressed search button to search record and if no record found then dataset / datagrid becomes empty, now i wanted to search an other record with other name, but this time it does not work and following error appears
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
my question is how to solve above mentioned error, or reload my data into datagrid so that i may search again what i want to.
Please Help with this Problem
the code to search for specific record i m using is
Code:
Adodc1.RecordSource = "Select * from Records Where Name like'" & Text17.Text & "%'"
Adodc1.CommandType = ADODB.CommandTypeEnum.adCmdText
Adodc1.Refresh()
and in vb6 (before Conversion) it was
Code:
Adodc1.RecordSource = "Select * from Records Where Name like'" & Text17.Text & "%'"
Adodc1.CommandType = adCmdText
Adodc1.Refresh()
Please Help how to solve above mentioned error, or how to reload data in dataset (data grid, in my case)
Last edited by Cimperiali; March 4th, 2010 at 07:44 AM.
Reason: Added Code Tags
-
March 3rd, 2010, 07:13 PM
#2
Re: vb.net, Adodc.recordsource, Sql Search Problem
Go back and add Code Tags so we can read your code.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|