0

i want to connect plsql server with asp.net using C# and want to show data of server in grid view.


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)

{
OracleCommand cmd = new OracleCommand("SELECT wllpackagecode,wllpackagename,wllpackagedesc,sdate,edate,status,brandid FROM wllpackage ", new OracleConnection("Server=ip;Database=fg;User Id=dgfh; Password=hgh;Trusted_Connection=True;"));

try
{
cmd.Connection.Open();

gvwdata.DataSource = cmd.ExecuteReader();

gvwdata.DataBind();

cmd.Connection.Close();
cmd.Connection.Dispose();
}
catch (Exception ex)
{
lblStatus.Text = ex.Message;
}
finally
{

connection.Close();

}


}
}


error

Compiler Error Message: CS0234: The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by MeSampath
0

Hi,

Have you checked oracle client is installed in your system? This may be the root cause for the issue.

note:
Please use CODE Tags while including your source codes in the forum messages.

Good luck.

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.