Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions how to write a code for oracle database connection in asp.net for validation.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sarika vinod peddiram
how to write a code for oracle database connection in asp.net for validation.
1 Answer(s)      3 years and 8 months ago
Posted in : JavaScript Questions


<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>

Advertisement
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
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
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
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
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  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
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
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
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 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:nemathdba@gmail.com its a humble request my team
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...:*** a) If you are using oracle oci driver,you have to use: Connection conn
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
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
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
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
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
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
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
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
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
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
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
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 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
 

 

 

DMCA.com