Asp.net|oracle #region Statement
//----------------------------------------------------------------------
//
Modified: Li Miao (nick.lee)
//
Oracle9i connection ASP.net method and attention point
Time: 2005-3-18
Boyorgril@msn.com
qq:16503096
Note: Please indicate the source of the change, thank you
//----------------------------------------------------------------------
#endregion
Recommended Way
public void Oledboracle_dataset ()
{
String connectionstring= "Data source=mine;user=sys;password=sys;"; Write connection string
OracleConnection conn=new OracleConnection (ConnectionString); Create a new connection
OracleCommand cmd= New OracleCommand ("SELECT * from Fjdl.t_rights", conn);
DataSet ds = new DataSet ();
OracleDataAdapter oda=new OracleDataAdapter ();
Oda. Selectcommand=cmd;
Oda. Fill (DS);
Conn. Close ();
Datagrid1.datasource=ds. Tables[0]. DefaultView;
Datagrid1.databind ();
}
The following are four methods for using datasets and Datareader,oledb and Oralceclient
public void Oledboracle_datareader ()
{
System.Data.OleDb.OleDbConnection oledb1=new System.Data.OleDb.OleDbConnection ();
String sqltext= "select * from Scott.tadmin";
System.Data.OleDb.OleDbDataReader reader;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.