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

 
 


sarika vinod peddiram
how to write a code for oracle database connection in asp.net for validation.
1 Answer(s)      2 years and 5 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>
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 Pages:
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
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
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
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 &
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
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
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
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
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
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
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
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
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
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
database connection - SQL
database connection  hi friends, This is poornima i want to connect sql server to my eclipse editer how to connect and where i have to write code...-database connection in eclipse IDE? Thanks
jsp with database oracle
jsp with database oracle  hai i am doing one program in jsp i want to check the jsp life cycle methods so wrote one program, in which i write... with the name employee i am sending sample code to u. plz help me to fix
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
Validation
me to save the email id and contact number (mobile number) in a database (MySQL). How do i perform a check using JAVA on the data before storing it in the database? PLEASE HELP!!!!!   import java.awt.*; import java.sql.*; import
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
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
Asp.net
Asp.net  how to show an output of an Asp.net project work on a mobile phone
ASP.NET
ASP.NET  How to autogenerate id in Letters with numbers
ASP.NET
ASP.NET  what is the use of web.config file in ASP.NET programing... application. An Asp.net application has one web.config file which keeps the configurations... tags having specific meanings. Generally we store database connections, Session
ASP.NET
ASP.NET  How to get the value of dynamically added rows in a table using html
ASP.NET
ASP.NET  How to get multiple values of single textbox separated by commas using C
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
asp.net
asp.net  i am generating excel file through data base, in excel cell text are displaying with green triangle on the corner, how to convert text to number through c sharp coding
JDBC Connection code to connect servlet with oracle.
JDBC Connection code to connect servlet with oracle.  JDBC Connection code to connect servlet with oracle
connection
connection   how to make multiple database connection using jdbc
java connecting to oracle db - JDBC
java connecting to oracle db  how to connect oracle data base...) Connect to database:*********** a) If you are using oracle oci driver,you have to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8
Oracle Database error - JDBC
Oracle Database error   String query11 = "SELECT product_code... = stmt.executeQuery(query11); while(rs11.next()){ product_code[j] = rs11.getString("product_code"); product_quantity[j
DataBase connection with sql - Struts
DataBase connection with sql  How to connect sql and send db error in struts? what are the tag should i code in struts-confic.xml
connection with database - JSP-Servlet
and the connection with the database using jsp code, I get exceptions that I have... with java code. Is there any other way to establish a connection with database in jsp... with the database by writing the program in java. Following is the code: import
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
connection  sir i have created a web page for login form and i have also created the related data base in both ms access and oracle 10g now how to store those values in form to databases can u plz hlp me
ASP.NET books Page2
ASP.NET books Page2       Introduction of ASP.NET ASP.NET is a web programming platform... of doing things in ASP.NET with ways of doing them in other languages, especially
server database connection - JSP-Servlet
ODBC For Oracle}","scott","tiger"); But how to get the connection from..." in that case how we will get the database connection   Hi Friend, which database you want to use Oracle or MS Access? Thanks
validation.....
validation.....  hi.......... thanks for ur reply for validation code. but i want a very simple code in java swings where user is allowed to enter... give a message box that only numerical values should be entered. How can
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 database connection - Struts
java database connection  how to connect a database in struts program...; value="jdbc:mysql:///database_name?autoReconnect=true"...; </data-sources>put this code into ur struts-config.xmlAnd
connection
connection   How to get connected to my database using jsp   Please visit the following links: http://www.roseindia.net/jsp/connectjspwith_mysql.shtml http://www.roseindia.net/jsp/displaydatafrom_database1.shtml http
Oracle Books
, functionality, and reliability of the Oracle database. The nearly 800 pages... of and development of applications for Oracle database management systems). What's more... Interface Troubleshoot, diagnose, and optimize your Oracle database
database connection
database connection  how to connect the jsp page with database
database connection
database connection  i wanted to no how to connect sqlite database through netbeans? is it posible to connect it to a database that is on a remote pc? thank you
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