标签:os io ar 数据 cti sp on c line
using System;
using System.Data.Common;
namespace ConsoleApplication27
{
class Program
{
static void Main(string[] args)
{
DbProviderFactory dbFactory = DbProviderFactories.GetFactory("iAnywhere.Data.SQLAnywhere");
DbConnection dbconn = dbFactory.CreateConnection();
try
{
dbconn.ConnectionString = "User ID=dba;Password=sql;DataSourceName=\"SQL Anywhere 12 Demo\"";
dbconn.Open();
if (dbconn.State == System.Data.ConnectionState.Open)
{
Console.WriteLine("Connection is Open!");
dbconn.Close();
if (dbconn.State == System.Data.ConnectionState.Closed)
Console.WriteLine("Connection is Closed!");
}
}
catch (DbException dbexception)
{
Console.WriteLine(dbexception.Message);
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
}
Console.ReadKey();
}
}
}
标签:os io ar 数据 cti sp on c line
原文地址:http://www.cnblogs.com/bisslot/p/3959566.html