progress openedge db c# code example
Example: progress openedge odbc connection string c#
using System;
using System.Data;
using System.Data.Odbc;
public class TestConnect
{
public static void Main(string[] args)
{
string connectionString = "DSN=sports;" +
"UID=sysprogress;" +
"PWD=x";
IDbConnection dbconn;
dbconn = new OdbcConnection(connectionString);
dbconn.Open();
IDbCommand dbcmd = dbconn.CreateCommand();
string sqlstr = "SELECT country,name FROM pub.customer";
dbcmd.CommandText = sqlstr;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
string country = (string) reader["country"];
string name = (string) reader["name"];
Console.WriteLine("Customer : " + name + " country is: " + country );
}
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbconn.Close();
dbconn = null;
}
}