Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi all

this is abt a vb.net windows application

i have a typed dataset with data. and i have a textbox, user can enter any value there. and after user enters a value to the textbox i need to find whether that value is in the typed dataset

 

how can i do this.

 

i found a find function in a typed dataset row, but i can search only primary key using that.

 

the value which i need to find is not the primary key.

 

eg: in the typed dataset i have 2 fields

ID (Primary Key)

Name

 

i need to check name column with the entered text by user

 

can anybody tell me the syntax of how to this

 

thank you

Posted

Have a look at the 'RowFilter' property of the DataView object. You could use the RowFilter of the DefaultView object like this....

 

dataset.datatable.DefaultView.RowFilter = "Name = 'Jhon'"

 

and than check the Count property of the DefaultView object to see if it's bigger than 0

 

if (dataset.datatable.DefaultView.Count > 0)

{

// the name was found

}

qrt

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...