+ Reply to Thread
Results 1 to 13 of 13

Export Data in MS Visual studio to Excel

  1. #1
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Export Data in MS Visual studio to Excel

    Hey All,

    I'm having a wonderful time trying to do this and I don't know where to begin.

    I'm trying to export data I pulled from tables using MS Visual Studio to Excel. One approach the internet is telling me is to (1) export this to GridView (2) then Export GridView to Excel? I'm not sure if that's correct, but I thought I'd throw it down as something I'm looking into (without success).

    I could use some help on how to do this.

    Thank you,

    HD

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Export Data in MS Visual studio to Excel

    What language are you using in visual studio? How are you pulling the data? What environment are you running the code in? Is this a desktop application or a web application?
    Last edited by Kyle123; 09-30-2016 at 02:08 AM.

  3. #3
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Re: Export Data in MS Visual studio to Excel

    I am using SQL (SELECT / FROM/ WITH)

    I have very basic SQL knowledge - but I'm learning. I accessed a dbo. file and pulled a selection; now I'd like to export that selection to excel.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Export Data in MS Visual studio to Excel

    You aren't helping us help you, please answer the other questions

  5. #5
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Re: Export Data in MS Visual studio to Excel

    Quote Originally Posted by Kyle123 View Post
    What language are you using in visual studio? How are you pulling the data? What environment are you running the code in? Is this a desktop application or a web application?
    What language are you using in visual studio?
    - SQL

    How are you pulling the data?
    - from an SQL Query: SELECT all* FROM dbo.xxx WITH Division = 'division name'

    What environment are you running the code in?
    - MS Visual Studio's SQL input plane

    Is this a desktop application or a web application?
    - Desktop application (MS Visual Studio)

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Export Data in MS Visual studio to Excel

    Are you using Visual Studio or SQL server management studio?

  7. #7
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92
    Quote Originally Posted by Kyle123 View Post
    Are you using Visual Studio or SQL server management studio?
    Visual studio

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Export Data in MS Visual studio to Excel

    Why not just copy and paste it?

  9. #9
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Re: Export Data in MS Visual studio to Excel

    Well, that worked... jfc.

    Assuming I have a lot of data, is there anyway I can export?

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export Data in MS Visual studio to Excel

    Do you need Visual Studio to get the data?
    If posting code please use code tags, see here.

  11. #11
    Registered User
    Join Date
    08-30-2016
    Location
    Edmonton, Canada
    MS-Off Ver
    2016 64b
    Posts
    92

    Re: Export Data in MS Visual studio to Excel

    Yes.

    In a nut shell, I want to run some reports and SQL does it much faster than the front-end modules.

    I was hoping I could write some queries using SQL in MS Visual Studio which is connected to the Microsoft SQL Server and pull the reports faster (hours into seconds).

    The problem is exporting the data once I write a query. Copy/Paste does work, but I am worried about corrupted data/missing information with doing that process (I hate copy/paste).

  12. #12
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Export Data in MS Visual studio to Excel

    Just use msquery

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export Data in MS Visual studio to Excel

    Sorry, that doesn't really make sense.

    The data is not 'in' Visual Studio, in fact it sounds like the use of Visual Studio is as some sort of middleman, and that might be what's slowing things down.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel object limitation when using with Visual Studio
    By wiksyr85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2016, 08:13 AM
  2. Excel 2010 trying to install Visual studio
    By jeskit in forum Excel General
    Replies: 0
    Last Post: 03-24-2011, 07:53 AM
  3. Visual Studio 2008 Excel UDF
    By squiggler47 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2009, 10:24 AM
  4. Replies: 1
    Last Post: 09-13-2005, 07:06 AM
  5. excel object in visual studio
    By Easwaran in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2005, 09:05 AM
  6. [SOLVED] Visual Studio .Net C# and Excel
    By Adam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2005, 12:06 PM
  7. Excel C# programs with Visual Studio .NET on Windows XP Family Edi
    By Hugues Joly in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2005, 10:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1