Click here to Skip to main content
15,891,423 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSQL Server Connection Issue VB 2008 [modified] Pin
RP10825-Sep-09 18:22
RP10825-Sep-09 18:22 
AnswerRe: SQL Server Connection Issue VB 2008 Pin
RP10826-Sep-09 4:20
RP10826-Sep-09 4:20 
QuestionHow can I export a datagrid to excel? Pin
waner michaud25-Sep-09 7:41
waner michaud25-Sep-09 7:41 
AnswerRe: How can I export a datagrid to excel? Pin
David Mujica25-Sep-09 8:17
David Mujica25-Sep-09 8:17 
GeneralRe: How can I export a datagrid to excel? Pin
waner michaud25-Sep-09 8:43
waner michaud25-Sep-09 8:43 
GeneralExcel Pin
David Mujica25-Sep-09 9:54
David Mujica25-Sep-09 9:54 
GeneralRe: Excel Pin
waner michaud28-Sep-09 3:20
waner michaud28-Sep-09 3:20 
AnswerRe: How can I export a datagrid to excel? Pin
Johan Hakkesteegt25-Sep-09 8:54
Johan Hakkesteegt25-Sep-09 8:54 
The most reliable and flexible solution is to use xml.

First create an excel file in MS Excel. Format it according to what you would like the end result to look like. Save the file as xml.

Open the xml file with visual studio, and see what it looks like. Then use a string or streamwriter or whatever, to create a copy of the header part of your file. Then loop through your datagrid, dataset, or datatable, and add each row to the rows bit of the file.

If necessary finish off with any footer part of the file, and then save the whole thing as whateverfilename.xls

And presto! you can create an xls file without needing ms office installed on the machine that your app is running on, and that will work in any Excel version, not just the version that happens to be installed on the development machine.

My advice is free, and you may get what you paid for.

GeneralRe: How can I export a datagrid to excel? Pin
waner michaud25-Sep-09 10:52
waner michaud25-Sep-09 10:52 
Questiontodolist in vb.net Pin
mohsen3325-Sep-09 2:37
mohsen3325-Sep-09 2:37 
AnswerRe: todolist in vb.net Pin
Steven J Jowett25-Sep-09 3:03
Steven J Jowett25-Sep-09 3:03 
Questiongame competition Pin
maybel 25-Sep-09 2:22
maybel 25-Sep-09 2:22 
AnswerRe: game competition Pin
Dave Kreskowiak25-Sep-09 3:48
mveDave Kreskowiak25-Sep-09 3:48 
GeneralRe: game competition Pin
Christian Graus25-Sep-09 11:28
protectorChristian Graus25-Sep-09 11:28 
GeneralRe: game competition Pin
Dave Kreskowiak25-Sep-09 11:45
mveDave Kreskowiak25-Sep-09 11:45 
AnswerRe: game competition Pin
Christian Graus25-Sep-09 11:01
protectorChristian Graus25-Sep-09 11:01 
QuestionParameter is not valid. Pin
Anubhava Dimri24-Sep-09 21:00
Anubhava Dimri24-Sep-09 21:00 
AnswerRe: Parameter is not valid. Pin
Christian Graus24-Sep-09 21:54
protectorChristian Graus24-Sep-09 21:54 
GeneralRe: Parameter is not valid. Pin
Anubhava Dimri24-Sep-09 22:15
Anubhava Dimri24-Sep-09 22:15 
GeneralRe: Parameter is not valid. Pin
Christian Graus24-Sep-09 22:46
protectorChristian Graus24-Sep-09 22:46 
AnswerRe: Parameter is not valid. Pin
Dave Kreskowiak25-Sep-09 3:48
mveDave Kreskowiak25-Sep-09 3:48 
GeneralRe: Parameter is not valid. Pin
Anubhava Dimri25-Sep-09 18:07
Anubhava Dimri25-Sep-09 18:07 
GeneralRe: Parameter is not valid. Pin
Dave Kreskowiak25-Sep-09 18:38
mveDave Kreskowiak25-Sep-09 18:38 
GeneralRe: Parameter is not valid. Pin
Anubhava Dimri25-Sep-09 23:26
Anubhava Dimri25-Sep-09 23:26 
GeneralRe: Parameter is not valid. Pin
Dave Kreskowiak26-Sep-09 7:10
mveDave Kreskowiak26-Sep-09 7:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.