How to add dynamic coulmn in Gridview & its value.?
-
Hi My Gridview is displaying data as. SN ID 1 C120 2 C121 3 C124 4 C121 5 C128 6 C120 7 C121 when i click on one button this above grdview is displayed .my dataset is returning these 2 values. I want to display Count column in Gridview as SN ID Count 1 C120 1 2 C121 1 3 C124 1 4 C121 2 5 C128 1 6 C120 2 7 C121 3 if ID e.g in above gridview C120 is repeating 2 times & C121 is repeating 3 times.So I want to display as above shown Count . Please help How i do this. Thnx GroCareer
-
Hi My Gridview is displaying data as. SN ID 1 C120 2 C121 3 C124 4 C121 5 C128 6 C120 7 C121 when i click on one button this above grdview is displayed .my dataset is returning these 2 values. I want to display Count column in Gridview as SN ID Count 1 C120 1 2 C121 1 3 C124 1 4 C121 2 5 C128 1 6 C120 2 7 C121 3 if ID e.g in above gridview C120 is repeating 2 times & C121 is repeating 3 times.So I want to display as above shown Count . Please help How i do this. Thnx GroCareer
write your SQL so it returns this extra column, then bind to it. Always the easiest way. you could just add the column and use code to set the values, but why not do it in the DB?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
write your SQL so it returns this extra column, then bind to it. Always the easiest way. you could just add the column and use code to set the values, but why not do it in the DB?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
How to calculate Count's value in SQL. Please help how to write query for this. Thx Grocareer
It could be an expensive query, I'm thinking you need to ask for the count of items with the same Id, whose row number is less than the current one.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Hi My Gridview is displaying data as. SN ID 1 C120 2 C121 3 C124 4 C121 5 C128 6 C120 7 C121 when i click on one button this above grdview is displayed .my dataset is returning these 2 values. I want to display Count column in Gridview as SN ID Count 1 C120 1 2 C121 1 3 C124 1 4 C121 2 5 C128 1 6 C120 2 7 C121 3 if ID e.g in above gridview C120 is repeating 2 times & C121 is repeating 3 times.So I want to display as above shown Count . Please help How i do this. Thnx GroCareer