.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!



Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

need C# code

Posted By: ramya     Posted Date: April 20, 2011    Points:5   Category :C#
Hi,

In sql database the procedure displays output as

name a1 a2 a3 c1 c2 c3
__________________________
ram 0 0 0 0 0 0
xy 34 56 44 sy sz sx
ty 0 0 0 0 0 0

Now i want to use this procedure and write a code in c#. I want out put as follows in dataset

34sy
56sz
44sx



Responses
Author: Mahesh             
Posted Date: April 25, 2011     Points: 20   

Hi,
first of all collect the result in one datatable by executing stored procedure and the use datatable.select method and iterate through each column so that you get new datatable as per u r req...

hope this helps...

Thanks
Mahesh

Author: Narayanan             
Posted Date: July 24, 2011     Points: 20   

hi,
try this .
Create view Table
SELECT (a1 + c1 ) AS Column1
FROM Table;
union all
SELECT (a2 + c2 ) AS Column1
FROM Table;
union all
SELECT (a3 + c3 ) AS Column1
FROM Table;




Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend