Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Symposium 4.2 database thru ODBC or ADO.NET using C# Vis

Status
Not open for further replies.

cperdue

Programmer
Jun 12, 2006
3
US
Connecting to Symposium 4.2 database thru ODBC or ADO.NET using C# Visual Studio [22/9/2006 18:52:09]

I am wanting to know how to connect to the Sybase Database on Symposium 4.2.

1. Is this the correct way to capture data. Currently it connect but I cannot get the data back.

using System.Data.Odbc;

string ConnectionString = "Driver={SYBASE ASE ODBC Driver};Srvr=Symposium_Reports;Uid=userid;Pwd=password;";
ConnectionString = @"select * from dbo_eCallByCallStat";
OdbcConnection myConnection = new OdbcConnection(ConnectionString);
{
myConnection.Open();
OdbcCommand myCommand = new OdbcCommand(Query, myConnection);
OdbcDataReader myReader = myCommand.ExecuteReader();

// loop: read from DB
while (myReader.Read())
{
console(myReader.GetValue(0).ToString())
}
myReader.Close();
}
catch (System.Exception eZ)
{}
myConnection.Close();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top