473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

dataview find?

i've created a search function, using vc#, and i'm using the dataview.find()
method to get the index of the found record. the problem is that there are
many similar names. it always returns the same index, but it can be any one
of the items. as an example, if i type in the work "bolt" it will return the
index 1201, the first "bolt" is at 1120 and the last one is at 1294. it is
for a point of sale program and i have no control over the part titles. it
sorts them in alpha order and i need it to point to the first "bolt" in the
dataview (which is bound to the datagrid). i've also tried using the
dataview.findrows() method but can not find a way to get the index from the
rows. if i could get the index from the findrows() then i could just point
the CM to it. is there anyway to get that index?

thanx in advance.
Nov 19 '05 #1
3 2139
try .Sort first

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"oscar" <os***@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
i've created a search function, using vc#, and i'm using the
dataview.find()
method to get the index of the found record. the problem is that there
are
many similar names. it always returns the same index, but it can be any
one
of the items. as an example, if i type in the work "bolt" it will return
the
index 1201, the first "bolt" is at 1120 and the last one is at 1294. it
is
for a point of sale program and i have no control over the part titles.
it
sorts them in alpha order and i need it to point to the first "bolt" in
the
dataview (which is bound to the datagrid). i've also tried using the
dataview.findrows() method but can not find a way to get the index from
the
rows. if i could get the index from the findrows() then i could just
point
the CM to it. is there anyway to get that index?

thanx in advance.

Nov 19 '05 #2
have to .Sort before .find or .findrows will work. it sorts them in the
right alpha order, but just does not go to the first instance of my search
criteria.

"Curt_C [MVP]" wrote:
try .Sort first

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"oscar" <os***@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
i've created a search function, using vc#, and i'm using the
dataview.find()
method to get the index of the found record. the problem is that there
are
many similar names. it always returns the same index, but it can be any
one
of the items. as an example, if i type in the work "bolt" it will return
the
index 1201, the first "bolt" is at 1120 and the last one is at 1294. it
is
for a point of sale program and i have no control over the part titles.
it
sorts them in alpha order and i need it to point to the first "bolt" in
the
dataview (which is bound to the datagrid). i've also tried using the
dataview.findrows() method but can not find a way to get the index from
the
rows. if i could get the index from the findrows() then i could just
point
the CM to it. is there anyway to get that index?

thanx in advance.


Nov 19 '05 #3

"oscar" <os***@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
i've created a search function, using vc#, and i'm using the dataview.find() method to get the index of the found record. the problem is that there are many similar names. it always returns the same index, but it can be any one of the items. as an example, if i type in the work "bolt" it will return the index 1201, the first "bolt" is at 1120 and the last one is at 1294. it is for a point of sale program and i have no control over the part titles. it sorts them in alpha order and i need it to point to the first "bolt" in the dataview (which is bound to the datagrid). i've also tried using the
dataview.findrows() method but can not find a way to get the index from the rows. if i could get the index from the findrows() then i could just point the CM to it. is there anyway to get that index?

thanx in advance.


have you tried something like dataview.rowfilter = "PartsName = '*'bolt'*"
It should return all rows with bolt and then you can .sort it and get the
first record? If the list doesn't sort properly you may need to add a column
in code to the datatable which has information needed to sort the table.
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rob | last post by:
Hi I have a dataset that is ordered by the primary key, but when I view it in a dataview with the sort propery filled in with the primary key, the order is different. The data that seems to cause...
4
by: Charles A. Lackman | last post by:
Hello I have created a Dataview and have sorted it on the Date and ShiftNumber columns this works great, but when I want to use the Find Method it gives me the following error: Expecting 2...
0
by: MichaƂ Januszczyk | last post by:
Is it possible somehow to retreive {data Key Value} based on clicked {datagrid item index} ? Now i'm trying to do this in the following way, but with no effect. Now, Instead of getting value...
6
by: Dazz | last post by:
Hi I desperately need some help. I want to have a DataView sorted alphabetically by a specific column, then I want to find the first record that begins with the letter the user inputs and get...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
11
by: Tim Frawley | last post by:
I need to return a DataRow or the Row Index in a DataSet wherein the value I am attempting to find is not a primary key. I have to do this often, more than 200 times when importing a file so it...
4
by: Aaron Smith | last post by:
Dim dv As DataView = New DataView(FacilitiesDS1.Facilities, "", "ID ASC", DataViewRowState.CurrentRows) Dim iPos As Integer = dv.Find(dr.Item("ID")) Me.BindingContext(FacilitiesDS1,...
5
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I need to locate a row (or see if it exists) in a table contained in a dataset. The DataView.Find method seems to work OK for one criteria but I need to use 2 criterias. Is there...
0
by: Pravin Pujari | last post by:
Hi All, I am using .net framework 1.1 and c#. I have one problem regarding dataview. I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.