progress openedge odbc connection string c#
using System;
using System.Data;
using System.Data.Odbc;
public class TestConnect
{
public static void Main(string[] args)
{
//The connection string assumes there is a DSN named sports for a Progress database.
//Alternatively, a DSN-less connection string could be used in its place. See article# 000022406 for more details.
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;
}
}
Also in C#:
- change Backcolor c#
- vb.net check if datatable has rows
- csharp attributes as generics constraints
- download and run exe c# 1 button
- how to destroy a gameobject after some hits in unity 3d
- remove from list based on condition c#
- c# get current directory xamarin
- C# graph api upload file one drive
- c# string code ascii
- c# make http request
- ASP select box all states
- c# download string url
- c# linq select specific columns
- unity get velocity of gameobject
- c# null conditional operator if statement
- unity c# public all codes
- while loop c#
- validating file upload asp.net core mvc
- how to reduce garbage collection c#
- load scene unity
- sending data photon c#
- disable mouse unity
- run async methods within a sync process
- combine two arraylist c#