Click here to Skip to main content
Click here to Skip to main content
Go to top

MaxDB Connection

, 22 Jan 2008
Rate this:
Please Sign up or sign in to vote.
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 Smile | :)


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)

Share

About the Author

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

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 22 Jan 2008
Article Copyright 2008 by zadeveloper.com
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid