TableName:Upload
| ID | Keyword |
| 1116 | Dot Net |
| 2836 | Dot Net |
| 5636 | Dot Net |
TableName:Index_list (Resultant Table)
| ID | Keyword |
| 1116,2836,5636 | Dot Net |
Sir i need the sqlcommand query to get resultant table in asp .net(c# language)
I tried the following command,but it gives the result same as Upload table.
SqlCommand cmnd= new SqlCommand("select Upload.Keyword,ID=replace((select ID as [data()] from Index_list where Index_list.Keyword=Upload.Keyword order by ID for XML PATH('')),'',',') from Upload group by Keyword", con);
it works in SQL Server Management Studio,but not in Visual Studio 2012 sqlcommand .Please help.....


Shubham KumarRank #621 · 3.8K reputationPosted Feb 15, 2016, 10:41 PM EST
SqlCommand cmnd = new SqlCommand(query, con);
Shubham KumarRank #621 · 3.8K reputationPosted Feb 15, 2016, 9:35 PM EST
Shubham KumarRank #621 · 3.8K reputationPosted Feb 15, 2016, 9:41 PM EST
Shubham KumarRank #621 · 3.8K reputationPosted Feb 15, 2016, 9:57 PM EST
Shubham KumarRank #621 · 3.8K reputationPosted Feb 15, 2016, 11:20 PM EST
-------------------------- ----------
10, 100, 1000, 1000 a
Shubham KumarRank #621 · 3.8K reputationPosted Feb 15, 2016, 11:31 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 9:38 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 9:53 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 10:06 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 10:17 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 11:15 PM EST
Amit Kumar SinghRank #562 · 4.3K reputationPosted Feb 15, 2016, 11:28 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 11:29 PM EST
Saafia NM56 reputationPosted Feb 15, 2016, 11:30 PM EST