Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Export dataset into excel sheet in C#
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dhanalakshmi
Starting Member

India
12 Posts

Posted - 10/20/2011 :  04:22:45  Show Profile  Reply with Quote
Hi All,
How to export data set into a new excel sheet in C#?

Can you please help me?


Thanks,
Dhanalakshmi.

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 10/20/2011 :  04:26:56  Show Profile  Reply with Quote
you mean export data stored in sql table to excel?
if yes, you dont need c#
you can use OPENROWSET or SSIS export import wizard

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Dhanalakshmi
Starting Member

India
12 Posts

Posted - 10/20/2011 :  04:38:09  Show Profile  Reply with Quote
No, I need to export data set(sql query result)into excel through C# application?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 10/20/2011 :  04:40:45  Show Profile  Reply with Quote
even then you can use ssis export/import wizard. no need of using c# unless you've any other reason

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22864 Posts

Posted - 10/21/2011 :  03:38:35  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
If you want to do it in C# see code examples in C# site. You can however do it via sql using openrowset. See this for more details http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 10/21/2011 :  04:40:14  Show Profile  Reply with Quote
you need to make sure you've enable ad-hoc distributed queries if you've to use opnrowset

http://www.kodyaz.com/articles/enable-Ad-Hoc-Distributed-Queries.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

charlesbecon
Starting Member

3 Posts

Posted - 11/03/2016 :  01:45:39  Show Profile  Reply with Quote
Check this one....[url=http://csharp.net-informations.com/excel/csharp-excel-export.htm]C# Excel Export[/url]

Charles
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000