Oracle Client 连接 Server 并通过代码测试连接

Oracle客户端配置

步骤一:

image

步骤二:

image

步骤三:

image

步骤四:

image

步骤五:

image

最后测试成功

image

 

注:

如果是客户端配置可以不用添加

image 程序同样可以进行连接,如果是服务器则需要配置。

程序连接

namespace OracleConnectionTest
{
    using System.Data.OracleClient;
    using Dapper;


    class Program
    {

        private static string connString = "Data Source=wjdb;User Id=xxx;Password=xxx;";
        static void Main(string[] args)
        {
            using (var connection = new OracleConnection(connString))
            { 
                var source = connection.Query("select * from logs t where t.ID = :ID", new { ID = "2006000194" });
                 
            }


        }
    }
}
posted @ 2013-09-29 11:18  吉桂昕  阅读(1815)  评论(0编辑  收藏  举报