Hello All
Need help with LINQ
I have this sticky issue with using select statements from within my code . I dont know how to use one.
The code for the method and the xml structure are as attached.
This is part of the code
| public void PopulateGrid(DataSet dataSets, String tableName,String testStepId) { this.dataSet = dataSets; //'this' here is a usercontrol - an Editable Data Grid View to be precise. IEnumerable<Int32> dfp2 = from paramss in dataSet.Tables["Parameters"].AsEnumerable() where (paramss.Field<Int32>("TestStep_Id") == Int32.Parse(testStepId)) select paramss.Field<Int32?>("Parameters_Id"); var p2 = from parameter in dataSet.Tables["Parameter"].AsEnumerable() where parameter.Field<Int32>("Parameters_Id") == (Int32)dfp2.First() select parameter; // bindingSource.DataSource = parameter.AsDataView(); bindingSource.DataSource = p2.AsDataView(); . . . . } |
-
-
As you can see there are two teststep commands {SetCT and ReadCT } and each has a parameter to it .
My app has two data grid views - one for test steps and the other for parameters pertaining to those test steps. So whenever i click on one of the test steps , i populate the second data grid view with paramters pertaining to the clicked test step.{The above code populates the data grid view for paramters NOT test steps}
How do i frame my select statement so as to be able to get the parameter pertaining to the test step that i have clicked? Is there a better way to do it than what is mentioned above?
Thanks
Avink
Lalit MPosted Jan 6, 2010, 5:38 AM
http://vb.net-informations.com/xml/vb.net-xml-to-DataGridView.htm