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.findro ws() 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. 3 2154
try .Sort first
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"oscar" <os***@discussi ons.microsoft.c om> wrote in message
news:DC******** *************** ***********@mic rosoft.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.findro ws() 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 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***@discussi ons.microsoft.c om> wrote in message news:DC******** *************** ***********@mic rosoft.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.findro ws() 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.
"oscar" <os***@discussi ons.microsoft.c om> wrote in message
news:DC******** *************** ***********@mic rosoft.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.findro ws() 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.rowfil ter = "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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 the problem has a dash in it
The dataset records are in this order
bc-misc-label-rpt.exe
bc-MiscLabelPrint.exe
bc-printer-report.exe...
|
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 value(s) for the key being indexed, but received 1 value(s).
I have tried the following:
Dim Names(1) as Object
|
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 according to specified sort key i get wrong data
HandleInnerDGRControlItemClick(Object sender, DataGridCommandEventArgs args)
{
int clickedIndex =...
|
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 that record number. I
don't however want a filter as the user must still be able to scroll up and
down the DataView.
Thanks. Any help would be...
|
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 the confusion.........
I thought that the DataView is the view from the dataset, but it seems that
the dataview has the records that are in the...
| |
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 needs to be fast.
Could I use a Dataview to filter for the value (which is unique) and
return either the DataRow object so I can modify it and put...
|
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, "Facilities").Position = iPos
That is the code.. dr is DataRow. If dr.Item("ID") = 3, the find will
return position 0, which it should have been 1, and if the...
|
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 DataGrid
on my page. This works well, however, like I said, I would like to
keep from having to fill the DataView on each PostBack. So,...
|
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 anything in VB2005 that does was DLookUpd
does in Access - but for a table contained in a Dataset? I realize that
DLookUp works on Physical tables...
|
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 am displaying the dataview. All rows in dataview are displayed in the sequence as they appear in dataview. i.e. there is direct mapping between...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |