How to use ODP.NET on aspx page (not in compiled code-behind)

Hi Folks.

I'm trying to use the ODP.NET provider in an .aspx file in a <script> block. The page is not part of a "project", does not have a code-behind page, is not compiled, and I am not using VS.NET for development.

<%@ Page Language="C#" %>
<%@ Import namespace="System" %>
<%@ Import namespace="System.Data" %>
<%@ Import namespace="Oracle.DataAccess.Client" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
OracleConnection con = new OracleConnection();
con.ConnectionString = "User Id=usr1;Password=usr1;Data Source=ds1;";
}
</script>

When I do that, I get the following error...
"The type or namespace name 'Oracle' could not be found (are you missing a using directive or an assembly reference?)"
I know how to setup the reference to Oracle.DataAccess in VS.NET, but this page is not part of a compiled project/application. I don't know how to setup the reference in the .aspx file.
Any ideas?
Thanks.
DS
0
dshaykewich
7/28/2004 7:04:56 PM
asp.net.oracle 2269 articles. 0 followers. Follow

1 Replies
864 Views

Similar Articles

[PageSpeed] 6

FYI, I solved this with some help in another forum.

Please see the "Reference to DLL in ASPX Page" thread in the 'Web Forms' forum.
http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=649592
0
dshaykewich
8/16/2004 9:48:33 PM
Reply:

Similar Artilces:

Setting width for .net controls in code(.aspx) page using function call in code behind..
Hi,  Currently I am trying to set the width of the asp.net Table as follows. <asp:Table width="<%=GetWidth()%>" >   and code behind protected Unit GetWidth() { return Unit.Percentage(50); }     It's not working. I know that it works if I set the width complete on some page event(like page_load) of code behind....   Is there a way to maintain the same syntax like calling code behind function in design page...i.e. calling function of .aspx.cs in .aspx page and assign the width as shown above.   Thanks and regards, Giridhar...

Using code compiled code behind instead of aspx pages
Hi There, I have some code I wish to release to a customer (its a photo gallery with upload, autothumbnail and watermarking facilities). Currently this is in one stonking vb aspx file, and I was working under the (wrong) assumtpion I could just obfuscate the code ala html mangler (which I find I cant). So, I need to create a .vb code behind - which is ok - I dont mind the extra work, but having read some bits about this I have the following questions and would be grateful if anyone could point me in the right direction. 1) I dont particularly want the user screens html source vie...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

Problem with Oracle Stored Procedures using ODP.NET in VB.NET (VS 2003)
This is the stored procedure,Procedure RetrieveReservations(pProperty In Varchar2,pResHeaderId In Varchar2,pEmail In Varchar2,pPasswd In Varchar2,ResultSet In Out ResCursor);This is the old .asp code (part of it)objConn.ConnectionString = Application("BackEndConnection_ConnectionString")objConn.Open objComm.ActiveConnection = objConn objComm.CommandText = "internet_package.RetrieveReservations"objComm.CommandType = adCmdStoredProc objComm.Parameters.Append objComm.CreateParameter("pProperty", adVarChar , adParamInput, 8, Request.QueryString("propid"))objComm.Parameters.Append objComm.Crea...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

ODP.NET
I installed ODP.NEt 2.0 on top of my Oracle client 10g. I am developing a Data Access component. I am having the below problem.  I created the Data Layer class. The constructor of the data layer class initiates a new Oracle Connection.  then I assign the Oracle Transaction obbject to the open connection. In my web page, I instantiate the DataLayer class and then call BeginTransaction method.  At this point, my connection object is null.  What am I missing?  I am getting Externalcontext connection error and Internalcontext error with the error message "Specified slot...

Putting Code behind (vb.net) variable into MS SQL insertcommand statement in aspx page
Hi, I have a variable in my code behind that I need to be thrown into my db with other values. Using .net 2.0, v b, sql server 2005.  Below is the InsertCommand line of SqlDataSource1, you can see [picture1] does not have a matching value, that value that needs to get thrown in there is in the code behind. What is the method and syntax of doing this? Thanks.  1 InsertCommand="INSERT INTO [news] ([headline], [body], [bullet1], [bullet2], [bullet3], [highschool_first], [highschool_second], [picture1]) VALUES (@headline, @body, @subhead1, @subhead2, @subhead3, @highschool_firs...

Using a code behind page with multiple aspx pages
I have built a small site with a simple CMS that allows editing of content on the pages using an Word-like HTML editor. I allow the CMS users to control the Meta and Title tags of the pages as well. I have a codebehind page for the public homepage, Default.aspx. This codebehind page contains code that queries the database for the Meta and Title tags, and  uses System.Web.UI.Page to add the <meta> and <title> tags to the header tag. Since each public aspx page needs to do this, I changed the codebehind attributes to use the same codebehind page as Default.aspx. For example, ...

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

Both C# ASPX pages and VB.NET ASPX in single VB.NET Web Applcation Template
Hi.. Is it possible to have both c# pages and VB pages in same Webapplication, what i chose is VB.NET Web application Template. With Thanks, Jaya.... I don't see why you couldn't, but for the sake of consistency I don't know why you would want to do this. When you choose a C# or VB.NET application template(I'm assuming you're using VS or WebMatrix), it simply creates a .aspx file that includes a page directive that specifies the page language. If you created a C# template but want to use VB.Net instead, you need to go from: <%@ Page Language="C#" .... to...

which is shou i use? Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NET
Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NETI am confused?Which is better or which one should I use?BTW, I am going to use .net 2.0 with oracle 9. Can anyone tell me what shou I use for working with oracle database?Thanks very much in advance!Justin Oracle's data provider has more functionality than Microsoft's.If your doing transaction processing you can have SAVEPOINTs, which Microsoft's data provider does not provide.Also, Oracle has PL/SQL Associative Arrays which are very powerful.Oracle also allows you to bind parameters by name and pos...

Adding a C# code behind page to a existing vb.net project page
I tried to add a .cs file to ab existing vb.net project and it seems to be rejecting the .cs code. Is there a declaration i need to include in the .cs file so the compiler knows that the .cs file has c# code and not vb.net code? Unfortunately, with this version of VS.NET you can't mix languages, so you'll have to put either one in a component and compile it separately. DonDon Kiely, MCP, MCSDIn the Last Frontier, Interior AlaskaPlease post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem! vs.net 2003...

Inline Coding (i.e. no Code-behind) and Wilson Pages (.Net 1.1)
Hi, I'm developing a personal web site and planning on hosting it on Brinkster, but Brinkster does not allow codebehind or using Dlls (from what I understand). But I would still like to use Wilson Master Pages, if possible.  I downloaded the free source code from the Wilson Master Pages website, but I'm not an advanced enough .Net programmer to firgure out how to use the source code using inline code.  Normally, you would use something like:<%@ Register TagPrefix="Wilson" Assembly="WilsonMasterPages" Namespace="Wilson.MasterPages" %>  on your templated pages...

How do you compile and use a code behind page?
I compiled my code behind page and I'm trying to access it and its not worked.  It works fine as a .vb file.  I compiled it into a .dll and I put in the /bin folder.  What do I do now?  I asked before hand if I could use a compiled code behind file and I was told yes...I hope thats right. I'm getting this error: Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: '.dll' is not a valid lang...

Web resources about - How to use ODP.NET on aspx page (not in compiled code-behind) - asp.net.oracle

Looking at the code behind our three uses of Apache Hadoop - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Looking at the code behind our three uses of Apache Hadoop geschrieben. Du kannst den vollständigen ...

How Heartbleed Works: The Code Behind the Internet's Security Nightmare
By now you've surely heard of Heartbleed, the hole in the internet's security that exposed countless encrypted transactions to any attacker who ...

Anatomy of an interactive: a look at the code behind our Second Screen
... and Paralympics coming to town, this presented the perfect opportunity to try it on. Being mainly responsible for the client-side code, I'll ...

How Heartbleed Works: The Code Behind the Internet's Security Nightmare
By now you've surely heard of Heartbleed, the hole in the internet's security that exposed countless encrypted transactions to any attacker who ...

Resources last updated: 12/5/2015 12:29:48 PM