concatenating strings into one datagrid cell
-
Hello if anyone can please give me just a tiny sample of how I'd do this, not just what to do I will be so grateful. Just so you know. I have been googling for days on this and I'm not sure what to do as I am still pretty new to c#. This is what I want to do. I have a dataset and datagrid(search results table) displaying results like this. Siann Skills1 Siann Skills2 Siann Skills3 I want it to show this Siann Skills1,Skills2,Skills3. I have my select statement, then I have created a new datacolumn as I was told to do as below. Now after that, what do I do? How do I get all the skills in one column. I know I have to concatenate, and I have tried searching the net, but I can't find anything useful. is there any possibility for an example? dgSearchResults.Columns.Add(new DataColumn("skills", GetType())); :)
-
Hello if anyone can please give me just a tiny sample of how I'd do this, not just what to do I will be so grateful. Just so you know. I have been googling for days on this and I'm not sure what to do as I am still pretty new to c#. This is what I want to do. I have a dataset and datagrid(search results table) displaying results like this. Siann Skills1 Siann Skills2 Siann Skills3 I want it to show this Siann Skills1,Skills2,Skills3. I have my select statement, then I have created a new datacolumn as I was told to do as below. Now after that, what do I do? How do I get all the skills in one column. I know I have to concatenate, and I have tried searching the net, but I can't find anything useful. is there any possibility for an example? dgSearchResults.Columns.Add(new DataColumn("skills", GetType())); :)
You need to change your SQL so that you generate groups of skills for the one name, then you can render it easily from there.
Christian Graus - Microsoft MVP - C++ "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 )
-
You need to change your SQL so that you generate groups of skills for the one name, then you can render it easily from there.
Christian Graus - Microsoft MVP - C++ "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 )
Thanks but apparently I can't for some reason. I think I need a for each statement. It is just I don't know exactly what to put in there. I have foreach (DataSet1.EmpSkillsRow empskillsRow in empskillsDT.Rows) { } Apparently then I have to create an empty string and then another text string and then for each loop fill the particular cell. Basically every time a TechnicalSkillID belongs to the same EmployeeID, then display in the TechnicalSkills column in one cell. No one seems to know how this is done in C#. We all know what to do but not how exactly. Do you know? thanks kindly really.
-
Thanks but apparently I can't for some reason. I think I need a for each statement. It is just I don't know exactly what to put in there. I have foreach (DataSet1.EmpSkillsRow empskillsRow in empskillsDT.Rows) { } Apparently then I have to create an empty string and then another text string and then for each loop fill the particular cell. Basically every time a TechnicalSkillID belongs to the same EmployeeID, then display in the TechnicalSkills column in one cell. No one seems to know how this is done in C#. We all know what to do but not how exactly. Do you know? thanks kindly really.
If you're using SQL Server 2005, I'd say this[^] is what you need.
Christian Graus - Microsoft MVP - C++ "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 )
-
If you're using SQL Server 2005, I'd say this[^] is what you need.
Christian Graus - Microsoft MVP - C++ "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 )
-
If you're using SQL Server 2005, I'd say this[^] is what you need.
Christian Graus - Microsoft MVP - C++ "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 )
-
oh I thought I had 2005 but I was just told that the back end is still 2000. So is there any other option? Sorry. :(
I'm not sure, I'd suggest asking in the SQL forum.
Christian Graus - Microsoft MVP - C++ "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 )
-
I'm not sure, I'd suggest asking in the SQL forum.
Christian Graus - Microsoft MVP - C++ "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 )