Gridview Question
-
Good Afternoon All I have a Gridview that looks like this http://www.vuyiswamaseko.tiyaneproperties.co.za/images/Problem_Grid.JPG[^] As you can see in the Description Field there are Duplicates but with Different Cycle Template Field. I want my grid to look like this
DESCR |CYCLE TEMPLATE
Campbell Nancy |"6 10" |
Salhab W MR |"9" |
If it Finds a Duplicate it must Add the Cyle Template and Diplay it as a String and if there is no Duplicate , it must be Left with that String like Salhab W MR is "9" Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
Good Afternoon All I have a Gridview that looks like this http://www.vuyiswamaseko.tiyaneproperties.co.za/images/Problem_Grid.JPG[^] As you can see in the Description Field there are Duplicates but with Different Cycle Template Field. I want my grid to look like this
DESCR |CYCLE TEMPLATE
Campbell Nancy |"6 10" |
Salhab W MR |"9" |
If it Finds a Duplicate it must Add the Cyle Template and Diplay it as a String and if there is no Duplicate , it must be Left with that String like Salhab W MR is "9" Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
I do not know if the way I am telling is a correct way. But I solved this problem for me like this. 1) Fetch the data from the database into datatable. 2) Create another datatable and add new row to it. 3) Get the "Description" Column and add it as a column to the new table. Get the corresponsing Cycle Template solumn and add to table. 4) Loop throught the table with table.Select() to get all the rows having same description. 5) For each such row, get the cycle template and add it to the same column (Cycle Template which you added previously) In short, create a dynamic table this way and bind it to grid. Thanks, Nyoti
-
I do not know if the way I am telling is a correct way. But I solved this problem for me like this. 1) Fetch the data from the database into datatable. 2) Create another datatable and add new row to it. 3) Get the "Description" Column and add it as a column to the new table. Get the corresponsing Cycle Template solumn and add to table. 4) Loop throught the table with table.Select() to get all the rows having same description. 5) For each such row, get the cycle template and add it to the same column (Cycle Template which you added previously) In short, create a dynamic table this way and bind it to grid. Thanks, Nyoti
Can you please Give me an T-SQl example ? Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
Can you please Give me an T-SQl example ? Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
With T-SQL you will return an input from select query, which will look something like this. Description Cost Template description1 9 description2 10 description1 29 description3 8 description3 4 Get this into a datatable. You can do it either using adaptor.Fill (Dataset) and then dataset.Tables[0] Let me know if I understood your question correctly. Thanks.
-
Can you please Give me an T-SQl example ? Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
I can post the code may be by EOD today for this. Thanks, Nyoti
-
I can post the code may be by EOD today for this. Thanks, Nyoti
Thanks
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
With T-SQL you will return an input from select query, which will look something like this. Description Cost Template description1 9 description2 10 description1 29 description3 8 description3 4 Get this into a datatable. You can do it either using adaptor.Fill (Dataset) and then dataset.Tables[0] Let me know if I understood your question correctly. Thanks.
I wanted to do this in one side , if it can be done in SQl, then The SP should return a Complete data that does not need any manipulation from the C# side, if this can be done from C# side , then the Data can come in Duplicate manner and can be manupilated from C# side only. Thank you,
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
I wanted to do this in one side , if it can be done in SQl, then The SP should return a Complete data that does not need any manipulation from the C# side, if this can be done from C# side , then the Data can come in Duplicate manner and can be manupilated from C# side only. Thank you,
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
I think manipulation on C# side is better than looping at the stored procedure level. (Writing cursur,fetching the data and manipulate eaither into a string or temp table is I think expensive) Thanks, Nyoti