ผมมือใหม่เพิ่งหัดทำ asp.net ตอนนี้ติดปัญหาว่าเวลาที่จะทำการติดต่อกับ ฐานข้อมูล oracle มันจะึขึ้น error ข้างล่าง
Code
Error while trying to retrieve text for error ORA-12538
ผมลองหาใน internet แล้ว
Code
ORA-12538: TNS:no such protocol adapter
Cause: The protocol adapter requested (by way of the "(PROTOCOL=..)" keyword-value pair in a TNS address) is unknown. If the supplied address is typographically correct then the protocol adapter is not installed.
Action: Install the protocol adapter or correct typographically error, as appropriate. Note: if the supplied address was derived from resolving the service name, check the address in the appropriate file (TNSNAMES.ORA, LISTENER.ORA or SQLNET.ORA)
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;
namespace WebApplication11
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
OracleConnection objConn;
private void Page_Load(object sender, System.EventArgs e)
{
String strConnString;
strConnString = "Data Source=icb;User Id=icbt;Password=icbt2100;";
objConn = new OracleConnection(strConnString);
objConn.Open();
if(objConn.State == ConnectionState.Open)
{
Label1.Text = "Oracle Connected";
}
else
{
Label1.Text = "Oracle Connect Failed";
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Tag : .NET, Oracle, Web (ASP.NET), VS 2003 (.NET 1.1)
Server Error in '/WebApplication11' Application.
--------------------------------------------------------------------------------
Error while trying to retrieve text for error ORA-12538
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OracleClient.OracleException: Error while trying to retrieve text for error ORA-12538
Source Error:
Line 25: strConnString = "Data Source=icb;User Id=icbt;Password=icbt2100;";
Line 26: objConn = new OracleConnection(strConnString);
Line 27: objConn.Open();
Line 28:
Line 29: if(objConn.State == ConnectionState.Open)
SQLNET.ora
-----------------------------------------
AUTOMATIC_IPC = OFF
TRACE_LEVEL_CLIENT = OFF
names.directory_path = (TNSNAMES)
names.default_domain = world
name.default_zone = world