Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I'm hoping that someone with experience with programming against DB2 can help a new programmer down the correct path.

I've been given a project that requires me to pull data from tables in the companies DB2 database, and when all said and done have that data placed into an excel workbook. I don't have the DB2. NET Data Provider on my machine, and it doesn't appear that I can get it. Due to the nature of the company (financial institution), they would rather the application not use LINQ or anything like that. They prefer for us to write a query (using a .qry text file) and have the application read in that file, which would be located somewhere on the LAN.

Now, I understand (and can get help from co-workers) how to write the SQL part, and read it in. I am just sort of lost on how to A.) connect to and get the data out of DB2, and B.) systematically put it into an Excel workbook.

There have been some similar applications written against the DB2 that I can look at, but unfortunately they were written as Macros using VBA in Excel. They have brought me in as an intern because I am studying C# right now at school, and they want to start moving towards having programs being developed in .NET.

I have experience using the Microsoft Office Interop for Excel to automate Excel, so if I can learn how to make the extracted DB2 data into an object that can be "pasted" into Excel some way, that would work just fine.

Anyone out there that has experience programming against any sort of DBMS could probably point me in the right direction (either by explaining, or showing me where some tutorials are) as from what I understand, they are all pretty similar in this sense...and ANY help would be greatly appreciated!
Posted

1 solution

LINQ won't give you any data access without a data provider anyhow, surely you didn't think it would ?

I would say that you need to find that data provider. If it doesn't exist, your next bet is to ask yourself if they have a data provider in C++ or another language you can use to write a COM component that your .NET code can call. If they have any dlls that can call this DB, you can p/invoke them, you don't need COM.
 
Share this answer
 
Comments
ctsmith84 28-Jul-11 23:38pm    
I just can't don't have the DB2 .NET Data Provider (the one made specifically for DB2). I do have access to ODBC and Ole DB, which from what I've read can do it. I just don't have much knowledge on the subject yet, and can not figure out where to start.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900