You have to
1. Perform a .Select
2. Change the data
3. (Sometimes) commit the changes
Let's say you have a strong dataset called EmployeeDS with an
Employee(table). EmpID(int),LastName(string),FirstName(string)
EmployeeDS ds = //populate the ds somehow with employees
DataRow[] rows = ds.Select("EmpID=123");
//vb dim rows as DataRows() = ds.Select("EmpID=123");
//or
//DataRow[]rows = ds.Select("LastName='Smith'");
//or vb
//dim rows as DataRows() = ds.Select("LastName='Smith'");
now you have an array of rows
you loop over them, but you'll have to cast them
dim i as integer
for i = 0 to rows.Length - 1 //or .Count?
EmployeeDS.EmployeeRow currentRow = ctype(rows(i),
EmployeeDS.EmployeeRow
currentRow.LastName = "Jones" //change the data
next i
Console.Writeline (ds.GetXml())
Something like that.
"Anil Gupte" <an*******@icinema.comwrote in message
news:uz****************@TK2MSFTNGP02.phx.gbl...
How can I manipulate Datasets, such as getting a specific row based on a
key column value. Of course, I could loop through all the rows in the
entire dataset each time I needed something, but is there an easier way?
I want to be able to execute the equivalent of SQL statements including
insert, delete etc.
Any ideas? Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com