zw wrote:
On Feb 5, 5:07 pm, Göran Andersson <g...@guffa.com wrote:
>You can use the classes in System.Data.Odb c to connect using ODBC.
Can someone include a sample code using System.Data.Odb c with TimesTen
DB ?
Oracle told me that TimesTen doesn't have support for this.
What's the workaround if C# has to be used. Any advice ?
..NET supports ODBC.
TimesTen supports ODBC.
The obvious conlcusion is that .NET can use TimesTen via ODBC.
There are no tricks necessary !
Code example:
using System;
using System.Data.Odb c;
public class MainClass
{
public static void Main(string[] args)
{
OdbcConnection con = new OdbcConnection( "Dsn=TestTimesT en;");
con.Open();
OdbcCommand cmd = new OdbcCommand("SE LECT * FROM t1", con);
OdbcDataReader rdr = cmd.ExecuteRead er();
while(rdr.Read( )) {
int f1 = (int)rdr[0];
string f2 = (string)rdr[1];
Console.WriteLi ne(f1 + " " + f2);
}
con.Close();
}
}
Speak about straightforward code !
Arne