2010-06-28 195 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隨行司機也可能是有用的。