Filter dataset
-
Hi, We can filter the Data from DataSet as follows.. 1. Fetching Filtered Data and Filling to DataSet. ------------------------------------------------- OleDbDataAdapter1.SelectCommand.Parameters("ACNo").Value = "60891234" OleDbDataAdapter1.Fill(DataSet11) 2. Dim FilRows As DataRow() = _ Dset.Tables(0).Select("ACNo='60891234'", "ACHName", DataViewRowState.Added ) Dim r As DataRow Dim c As DataColumn For Each r In FilRows For Each c In r.Table.Columns Console.Write( "\t {0}", r(c) ) Next c Console.WriteLine() Next r Notes : ------- "ACNo='60891234'" = Condition for Fintering Data "ACHName" = Column to Sort The Data. With Regards, Pandian S
-
Hi, We can filter the Data from DataSet as follows.. 1. Fetching Filtered Data and Filling to DataSet. ------------------------------------------------- OleDbDataAdapter1.SelectCommand.Parameters("ACNo").Value = "60891234" OleDbDataAdapter1.Fill(DataSet11) 2. Dim FilRows As DataRow() = _ Dset.Tables(0).Select("ACNo='60891234'", "ACHName", DataViewRowState.Added ) Dim r As DataRow Dim c As DataColumn For Each r In FilRows For Each c In r.Table.Columns Console.Write( "\t {0}", r(c) ) Next c Console.WriteLine() Next r Notes : ------- "ACNo='60891234'" = Condition for Fintering Data "ACHName" = Column to Sort The Data. With Regards, Pandian S
Thanks Pandian for ur prompt reply below is my code. Actualy i wanted to modify filted dataview. can u give some suggestion on this. daConverstion.SelectCommand = scmdConversion daConverstion.Fill(dsConversion, "Duplicate") Dim MyDataView As DataView = New DataView(dsConversion.Tables("Duplicate"), "Duplicate_Group_Id=100", "Duplicate_Group_Id", DataViewRowState.CurrentRows) MyDataView.AllowEdit = True MyDataView.Item(0).Row(0) = "11"