Click to See Complete Forum and Search --> : delete rows by keys
ronlahav
Feb 9th, 2003, 07:53 AM
does anybody have an idea how can i find a row in defailt view table by key value that i have ?????
Iouri
Feb 9th, 2003, 10:11 AM
Originally posted by ronlahav
does anybody have an idea how can i find a row in defailt view table by key value that i have ?????
dim MyRow as DataRow()=ds.Tables("MyTable").Select("ID = 5")
MyRow is an array of DataRows. Each row (element of the array) contains Item collection
MessageBox.Show(MyRow(0).Item("Name")
If you want to search by key based on several fields
Dim vals As String() = {"Value1", "Value2"}
Datatable1.PrimaryKey = New DataColumn() {.Columns("Column1"),
.Columns("Column2")}
dim dr as system.data.datarow = Datatable1.Rows.Find(vals)
ronlahav
Feb 10th, 2003, 02:20 AM
thanks for helping me.
mabe i didnt clarify my self as well...
my question is not just how i find row in the dataset.
i have key which type is integer and i want to find a row in dataset table and then to delete it. when i find the row in the dataset i dont knoe how to delete it from the dataset????
pleeeeeesssssseeeee help me!!!!!!!!!!!!!!!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.