Click here to Skip to main content
Licence CPOL
First Posted 22 Jan 2008
Views 11,030
Downloads 118
Bookmarked 19 times

MaxDB Connection

By | 22 Jan 2008 | Article
How to connect ot MaxDB with c#

Introduction

I have noticed a very small amount of support available for MaxDB. I have had the need to interface a dot net application to MaxDB for for the following reasons:

1. MaxDB is our SAP backend and I can host my database on the SAP server eliminating the need to me to do further maintenace on a new db.

2. Performance of the SAP database server.

3. The database is free :)


Using the code

The code is pritty simple. All the application does is connect ot a MaxDB database.

SQLConnection is obviously out of the question as it only connects to a SQL server, So I have used the next best thing. Odbc connection. The reason for this is I can have my data access seperate from my business logic and as such still you data tables and adapters.

OdbcConnection con = new OdbcConnection("driver=sap db;servernode=" + txtServer.Text + ";serverdb=" + txtDatabase.Text +
                                                    ";uid=" + txtUserName.Text.ToUpper() + ";pwd=" + txtPassword.Text.ToUpper());
            try
            {
                con.Open();
                MessageBox.Show("Successfully connected to Database");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            } 


Hope this helps someone ... basically all it is is a connection string for MaxDB.

License

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

About the Author

zadeveloper.com

Architect
Unitrade
South Africa South Africa

Member

Born Jarrod Pereira in 1981
 
Finished School in 1999
 
Developer ever since Smile | :)
 
Happy coding.
 
All things are possible through Christ who strengthens me.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 22 Jan 2008
Article Copyright 2008 by zadeveloper.com
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid