using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OracleClient;
public partial class Query : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label3.Text = "";
    }    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text =="")
        {
            //MessageBox.Show("請輸入P001!", "操作提示");
            Label3.Text = "請輸入P001!";
        }
        string constring = "Server=192.168.2.81;Data Source=BRISA;Persist Security Info=True;User ID=roebrisa;Password=roemanager;Unicode=True";
        OracleConnection conn = new OracleConnection(constring);
        conn.Open();        string sqlstring = "select MR_NO from r_wip_panel where SHIPPING_PALLET_NO='" + TextBox1.Text.ToString().Trim() + "' ";
        OracleCommand cmd = new OracleCommand(sqlstring, conn);        try
        {
            string result = cmd.ExecuteOracleScalar().ToString().Trim();
            TextBox2.Text = result;        }        catch
        {
        }        finally
        {
            conn.Close();
        }
    }
}編譯器錯誤訊息: CS0234: The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

解决方案 »

  1.   

    引用里添加System.Data.OracleClient这个了吗?
      

  2.   

    在上面添加一句
    using System.Data;
      

  3.   

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;
    using System.Data.OracleClient;写成这样了还不对。
      

  4.   

     string constring = "Server=192.168.2.81;Data Source=BRISA;Persist Security Info=True;User ID=roebrisa;Password=roemanager;Unicode=True";
      

  5.   

    1. 在引用中添加:System.Data.OracleClient.dll2. 连接串改成:
    string constring = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.81)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=roebrisa;Password=roemanager;";
      

  6.   

    在项目引用中添加:System.Data.OracleClient.dll的引用
    然后再在代码中using
    using System.Data;
    using System.Data.OracleClient;
      

  7.   

    代码中 选中OracleClient
    右键-解析-添加引用using.... 
      

  8.   

    必须在项目中添加上
    右键项目或bin文件夹,添加引用,找到System.Data.OracleClient
    添加上即可啊
      

  9.   

    现在在开发环境里可以用了,但是搬到服务器又不行了。真是要命呀。
    編譯器錯誤訊息: CS0234: The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)