ChrisCompleteCodeTrunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Odbc;
using System.Data;
namespace SynergyTester
{
class Program
{
static void Main(string[] args)
{
OdbcConnection cn = new OdbcConnection("DSN=xfODBC;");
try
{
cn.Open();
if(cn.State == System.Data.ConnectionState.Open)
{
Console.WriteLine("Connection Open...");
DataSet ds = new DataSet();
OdbcDataAdapter da = new OdbcDataAdapter("SELECT TOP 10 * FROM HISHDR", cn);
da.Fill(ds);
Console.WriteLine("Getting top 10 rows...");
foreach(DataRow row in ds.Tables[0].Rows)
{
Console.WriteLine(
String.Format(
"Second field value is {0}",
new object[] { row[1].ToString() }
)
);
}
ds.Dispose();
da.Dispose();
cn.Close();
cn.Dispose();
Console.WriteLine("Test Completed...");
}
} catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
|
Revision |
Author |
Commited |
Message |
1
|
BBDSCHRIS
|
Wed 22 Aug, 2018 20:08:03 +0000 |
|