|
10精币
正在测试无客户端连接oracle,已找到例子,但是在易语言中不知道怎么引用Oracle.DataAccess.dll文件函数??要是有用过的请指教,非常之感谢,引用网上某源代码,请高手转成易语言,再次感谢了
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Oracle.DataAccess.Client;
namespace dbtest2
{
class Program
{
static void Main(string[] args)
{
string CONN_STR = "Data Source=(DESCRIPTION="
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.128.152)(PORT=1521)))"
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LYNN)));"
+ "User Id=fangl;Password=fangl;";
if (string.IsNullOrEmpty(CONN_STR))
{
throw new Exception("连接失败!");
}
else
{
OracleConnection conn = null;
try
{
conn = new OracleConnection(CONN_STR);
conn.Open();
}
catch (Exception e)
{
Console.WriteLine("{0}second exception caught",e);
Console.ReadLine();
}
Console.WriteLine("连接成功");
Console.ReadLine();
if (null != conn)
{
conn.Close();
conn.Dispose();
}
}
}
}
}
|
|