Sql into Excel confusion [c# or vb.net]

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
21,887
I have no done this in a very long time and I'm confused as hell. I have two tables, one is the main Customer table, the other is the Purchases table.

I want to basically have something like this:

Customer 1
  • Purchase 1
  • Purchase 2
  • Purchase 3

Customer 2
  • Purchase 1
  • Purchase 2
  • Purchase 3

Please can you guys help me to do this. I have this example here but it's making no sense to me. Something is not right with the code's structure and not allowing this type of format.

http://www.codeproject.com/Tips/669509/How-to-export-data-to-Excel-in-VB-NET
 

rrh

Expert Member
Joined
Nov 29, 2005
Messages
4,031
Is there any reason why you can't use the built-in functions available via Excel's "Data" tab ?
 

initroot

Senior Member
Joined
Jul 30, 2011
Messages
896
I have no done this in a very long time and I'm confused as hell. I have two tables, one is the main Customer table, the other is the Purchases table.

I want to basically have something like this:

Customer 1
  • Purchase 1
  • Purchase 2
  • Purchase 3

Customer 2
  • Purchase 1
  • Purchase 2
  • Purchase 3

Please can you guys help me to do this. I have this example here but it's making no sense to me. Something is not right with the code's structure and not allowing this type of format.

http://www.codeproject.com/Tips/669509/How-to-export-data-to-Excel-in-VB-NET

PM me, I've done ALOT of COM interop coding.

And as rrh stated, why not use the DATA function and connect with SQL directly?
 

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
21,887
All right, I've never used SQL data function. This is part of a .NET application so the user has some options to selection then a spreadsheet is populated. Will this SQL data function still work with that. If I don't come right then I will take up your offer thanks Fransh. Being new to excel is a bit daunting.
 
Top