2010-06-28 198 views
-2

如何建立与asp.net前端的oracle10g express版本后端的数据库连接?请发送源代码。数据库连接

+1

这可能会给你一些提示:http://stackoverflow.com/questions/782181/connect-to-an-oracle-10g-database-with-microsoft-odbc-for-oracle – 2010-06-28 11:29:45

回答

1

一旦你downloaded the appropriate driver您引用的组件在你的项目,你可以对数据库执行SQL查询:

using (var conn = new OracleConnection(ConnectionString)) 
using (var command = conn.CreateCommand()) 
{ 
    conn.Open(); 
    command.CommandText = "SELECT id FROM foo;"; 
    using (var reader = command.ExecuteReader()) 
    { 
     while (reader.Read()) 
     { 
      // TODO: exploit the results 
     } 
    } 
} 

technical articles随行司机也可能是有用的。