473,387 Members | 1,548 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,387 software developers and data experts.

dataview find

Hi,
I have a datatable and am searching the column called File for a particular
value called xFile (a number).

DataView dv = new DataView(tCat, "", "File", DataViewRowState.CurrentRows);
int xrow = dv.Find(xFile);
MessageBox.Show(dv[xrow]["File"].ToString());

But the messagebox just shows xrow to be the value of xFile, not the row
it's in. What am I missing?

Thanks!
Mel
Nov 17 '05 #1
1 2714
Oops again. I realized I pasted the wrong code. (Sorry! - it's been a long
week, not to mention my cold...) What's going on is that, instead of
highlighting the same row that was highlighted previous to a column header
click, a different row is highlighted. This row is the xFileth row (xrow
seems to become xFile). Hope this makes sense. Any help would be great,
especially since it seems that

int xrow = dv.Find(xFile);

should give me the row number that contains xFile (right?).

Mel

"melanieab" wrote:
Hi,
I have a datatable and am searching the column called File for a particular
value called xFile (a number).

DataView dv = new DataView(tCat, "", "File", DataViewRowState.CurrentRows);
int xrow = dv.Find(xFile);
MessageBox.Show(dv[xrow]["File"].ToString());

But the messagebox just shows xrow to be the value of xFile, not the row
it's in. What am I missing?

Thanks!
Mel

Nov 17 '05 #2

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
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
jinu1996
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...

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.