Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on 

Could you point a way to obtain the a C# datatable row position after a successfull search in it?

Hi Experts

Could you point a way to obtain the a C# datatable row position after a successfull search in it?

             // The value is founded in DataSet using the key  val1
             DataRow[] foundRow = dsProdutos.Tables[tabela].Select("sb_pub =" +val1);

            // How to obtain   the DataSet's line position  that detains the value founded (?)

Open in new window


Thanks in advance.
C#.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
Fernando Soto
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

You can get the row index:

int index = dsProdutos.Tables[tabela].Rows.IndexOf(foundRow);

You'll want to verify foundRow is not null before you do this.
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

Thank you Fernando!
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Not a problem Eduardo, glad to help.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo