how to write a code for oracle database connection in asp.net for validation.

how to write a code for oracle database connection in asp.net for validation.

<script language="javascript" type="text/javascript">
function fill()
{
//<%@ import Namespace="System.Data" %>
//<%@ import Namespace="System.Data.ORACLEClient" %>

    var srcVal=event.srcElement.value;
    var ctrlName = event.srcElement.id;
    var srcCtrl = document.getElementById(ctrlName);
    var sql;
    var str;
    var v;

var con= new ActiveXobject('ADODB.Connection');
 alert('Enter a Valid Bill MOnth.');
 str="Provider=OraOLEDB.Oracle;Data Source=orabhiwa;User ID=itbhw;Password=itbhw;"
 con.open(str);
 rs = new Activexobject('ADOBD.Recordset');

 sql = "SELECT MAX(SERVDET_BILLMTH) FROM billinfo_service";
  rs.open(sql,con)
  alert(rs(0));
  v=srcVal.Value;
    if(v>=rs(0))
    {
     alert('Enter a Valid Bill MOnth.');
        srcCtrl.focus();
    }
    rs.close;
    con.close;
    }

</script>
View Answers

August 20, 2011 at 11:30 PM

Create a new project in Visual Studio using eight C#

Add reference to Oracle.DataAccess.dll file.

Typically this file can be found in C:\oracle\product\10.2.0\client_1\BIN directory. This directory may be different based on your oracle configuration.

using Oracle.DataAccess.Client; // C#

OracleDb= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=OTNSRVR)(PORT=1521)) ) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=ORCL) ) )

string OracleDb = "Data Source=OracleDb;User Id=scott;Password=tiger;"; // C#

string OracleDb = "Data Source=(DESCRIPTION="

"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521)))"

"(CONNECTDATA=(SERVER=DEDICATED)(SERVICENAME=ORCL)));"

"User Id=scott;Password=tiger;";

OracleConnection conn = new OracleConnection(OracleDb); // C#

DBConnection.Open(); // C#

string sql = "select dname from dept where deptno = 10"; // C#

OracleCommand cmd = new OracleCommand(sql, conn);

cmd.CommandType = CommandType.Text;

OracleDataReader dr = cmd.ExecuteReader(); // C#

dataread.Read();

lblCaptionText = dr["dname"].ToString(); // C# retrieve by column name

lblCaptionText = dataread.GetString(0).ToString(); // return a .NET data type

lblCaptionText = dataread.GetOracleString(0).ToString(); // return an Oracle data type

DBConnection.Close(); // C#

DBConnection.Dispose(); // C#

Kamleshkumar Gujarathi
If Man Does His Best... What Else Is There...









Related Tutorials/Questions & Answers:
how to write a code for oracle database connection in asp.net for validation.
how to write a code for oracle database connection in asp.net for validation...:\oracle\product\10.2.0\client_1\BIN directory. This directory may be different based on your oracle configuration. using Oracle.DataAccess.Client; // C
if my database(oracle) connection failure means wat is the code to write in exception ?
if my database(oracle) connection failure means wat is the code to write in exception ?  if my database(oracle) connection failure means wat is the code to write in exception
Advertisements
android connection to database oracle 10g
android connection to database oracle 10g  Hello, How i can connect my android application to my oracle 10g database
how to connection jsp to oracle database connections in netbeans ide
how to connection jsp to oracle database connections in netbeans ide  how to connect jsp to oracle database connections in netbeans ide?pls provide screenshots if possible
how to connection jsp to oracle database connections in netbeans ide
how to connection jsp to oracle database connections in netbeans ide  how to connect jsp to oracle database connections in netbeans ide?pls provide screenshots if possible
write excel file into the oracle database
write excel file into the oracle database  dear sir, i need the jsp code that reads the excel file and stores it into the oracle database table..and also i need the code to connect oracle database? thank u in advance
Java Connection to Oracle database
Java Connection to Oracle database  HI I am ubable to connnect jdbc to Oracle database.i had gone to control panel >>Administrative tool>>>Data source,in that forDNS name i typed Oracle and in TNS i culdn't
error oracle database connection?
error oracle database connection?  hi now i am trying to connect oracle database and also insert my data into table, but it's not working.. I created... in oracle table. my table name is logininfoclient_sla. this is my coding
About connection database oracle to java
About connection database oracle to java  Hi I culdn't connect oracle datebase to java.when i compile the program it is ok.but when i clicked... be TNS .Another important is that how to delete the Oracle version from the system.so
About connection database oracle to java
About connection database oracle to java   I culdn't connect oracle.... Another important is that how to delete the Oracle version from the system.so... Panel>>Administrative Tools>>Data Sources in that i selected Oracle
About connection database oracle to java
About connection database oracle to java   I culdn't connect oracle... .Another important is that how to delete the Oracle version from the system.so... Panel>>Administrative Tools>>Data Sources in that i selected Oracle
About connection database oracle to java
About connection database oracle to java  **Hi I culdn't connect oracle datebase to java.when i compile the program it is ok.but when i clicked... be TNS .Another important is that how to delete the Oracle version from
About connection database oracle to java
About connection database oracle to java  Hi I culdn't connect oracle datebase to java.when i compile the program it is ok.but when i clicked... be TNS .Another important is that how to delete the Oracle version from the system.so
REQ for connection b/w jdbc and oracle database
REQ for connection b/w jdbc and oracle database    REQ for connection b/w jdbc and oracle database    The Java classes to connect... tell the Oracle driver which method you want to use to connect to the database
how to generate reports from oracle database using jsp and ajax code
how to generate reports from oracle database using jsp and ajax code  ... sales report data from oracle database to jsp page please any one know how to do this send me a code to my email:[email protected] its a humble request my team
JDBC Connection code to connect servlet with oracle.
JDBC Connection code to connect servlet with oracle.  JDBC Connection code to connect servlet with oracle
How to connect to database to my application if the database is made up in oracle
How to connect to database to my application if the database is made up in oracle  How to connect to database to my application if the database...) Connect to database:***ADS_TO_REPLACE_3 a) If you are using oracle oci driver
Dropdown code to retrieve result from oracle database
Dropdown code to retrieve result from oracle database  Hi Friends, I... retrieve the result from Oracle database.We have procedures created already.Just... with code if possible.Oracle db.Using SQL developer,we manually execute queries
how to write code for this output?
how to write code for this output?   1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
How to connect to the database to my application if my database is made up in oracle
How to connect to the database to my application if my database is made up in oracle   How to connect to the database to my application if my database is made up in oracle
login page code in asp.net
login page code in asp.net  i need front end and backend code for login page in vb asp.net using sql server....having code for submit button
how to write a query for adding records in database
how to write a query for adding records in database  How write fire query in JSP for adding records in database
Hibernate- Oracle connection - Hibernate
to make a connection to oracle DB from eclipse. Thanks...Hibernate- Oracle connection  In Eclipse I tried Windows --> Open perspective--> other in that Database Development Right click
Could not establish the connection to oracle - JDBC
edition.When i installed oracle i changed password:puppy.My database is working is fine...) Connect to database:*********** a) If you are using oracle oci driver,you have to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8
oracle database backup using jsp
oracle database backup using jsp   I want to take the backup of oracle database.I want to write the code in jsp ,so that when the page is loaded a backup of the database is stored in one of my local drives.Is it possible to do
jsp connection with oracle.
jsp connection with oracle.  I want to connect with jsp to oracle,,,plz send me the codes
jsp connection with oracle.
jsp connection with oracle.  I want to connect with jsp to oracle,,,plz send me the codes
how to get the values to dropdownlist from oracle database
how to get the values to dropdownlist from oracle database   <...("oracle.jdbc.driver.OracleDriver").newInstance(); Connection con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.149.95:1521:MOBIRAC1","SCOTT","SCOTT"); Statement
storing csv into oracle database
storing csv into oracle database  i want jsp code for storing csv file into oracle database
File insertion into oracle database
File insertion into oracle database  How to Read and Insert a file (any format) into a Oracle database
java oracle connection problem - SQL
java oracle connection problem  I have successfully made connection with the oracle10g database that i am using and also able to put in data using... used MySQL database,try the following code: NameAddress
How to write jsp/servlet code to integrate LINKDIN?
How to write jsp/servlet code to integrate LINKDIN?  How integrate linkdin api's in java codding
need code for login in asp.net with c#
need code for login in asp.net with c#  hai iam trying to develop a project in asp.net with c#,so i need a code for login page using which admin and other users can log in.plz help me, thanks in advance
jsp-oracle validation - JDBC
, Implement validation code. Insert into database function...jsp-oracle validation  Dear friends, my validation not takes place. can you please tell me where the code is wrong, because sometimes it validates
Connecting Oracle database with struts - Struts
Connecting Oracle database with struts  Can anyone please provide me some solutions on Connection between Oracle database and struts
How to write the code for date in swings - Struts
How to write the code for date in swings  Hi Friends, I want to code for display the calendar.......technologies use only swing and core java also how to display calendar like that popup window.....please write and send me
how to display or retrive an image in jsp whose path is stored in oracle database
how to display or retrive an image in jsp whose path is stored in oracle database  how to display or retrive an image in jsp whose path is stored in oracle database and the image is stored in my pictures folder
How to write a session code - Java Beginners
How to write a session code   Once Again Thanks Deepak...Thanks for continuing responce I want using session in my project plz help me how to write a session code plz write a session code and post answer my personal id
Oracle Database connectivity probem
Oracle Database connectivity probem  hi Below is the code of oracle database connectivity, when i compile it, it will show the error... ("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin
How to write a error.jsp code - Java Beginners
How to write a error.jsp code  Thanks once again I have a session code pls help me that how can i write a error.jsp page. why use error.jsp...let me know that hw can i write the error.jsp code. plz send me error.jsp code
JSP Login Form with MySQL Database Connection and back end validation
Here we have created a simple login form using MySQL Database Connection and back end validation. We have also added a video tutorial of the program... database and matched with the input value given through the login form. Example
how to write a programm in C for included code below
how to write a programm in C for included code below  Here is my question 'how to write a program in C that runs your sql-xml application session. In the session, you can run SQL queries interactively. The query results
How to Upload a file directly to Oracle database using JSP or Servlets?
How to Upload a file directly to Oracle database using JSP or Servlets?  Hi I want to upload a file(csv or excel) to Oracle 10g Database using JSP..."); Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe
Connection to Database
is the code how I am connecting to MySQL: I am connection to MySQL database in 2... I manually make a connection to MySQL database in my web pages? How joomla... question is that how I can properly connect to my SQL database where I need
how to read data from excel file through browse and insert into oracle database using jsp or oracle???
how to read data from excel file through browse and insert into oracle database... be inserted into oracle database.. please help me sir...   hi friend..., in these examples MySQL is used as database system if you want to use the Oracle
asp.net
asp.net  My project requrement is when somebuddy fill a web form then all form value will save on database table..& also save that data in excel file......is it any solution of this problem. the code language is asp.net &
database connection
database connection  how to connect the jsp page with database
How to get data from Oracle database using JSP
How to get data from Oracle database using JSP  hello i have a simple problem in jsp in the sense to get data from the database like oracle . I have... data from the database like oracle), I have created one jsp program like
java to oracle code - JDBC
java to oracle code  please suggest m calculate the database performance between scaled images and unscaled images in the database

Ads