. Net + oracle + crystalReports web application development study notes (2)

Source: Internet
Author: User
I mentioned the basic configuration precautions last time. Now I am starting to develop the oracle database.
1. oracle database connection
However, if you have installed the oracle client, you have already specified the database server during configuration. Therefore, when you connect to the database, you can connect to the database by using three elements, namely, the database name (SID ), user name and password
SqlConnection con = new SqlConnection ("Provider = MSDAORA.1; User ID = UserID; Data Source = xf; Password = password ")
SQL Server does not need to install the client, so you must specify the Server and database name.
SqlConnection con = new SqlConnection ("workstation id = XIAOFENG; packet size = 4096; user id = sa; integrated security = SSPI; data source = xiaofeng; persist security info = False; initial catalog = xf ");
2. Use the functions and stored procedures in the oracle Package.
For example, run the following SQL statement: "select order_no, inventory_part_api.get_description (contract, part_no), part_no from SHOP_ORD where inventory_part_api.get_description (contract, part_no) like '% xizhilang 25% jelly % '";
1. in. net design (such as sqlDataAdapter design) cannot directly use functions and stored procedures in the package, if you want to use, you can copy the functions and stored procedures to be used in the package during design and declare them again during design.
2. Add code directly when. net is running, and the system will directly find the content in the package.
String strCommand;
StrCommand = "select order_no, inventory_part_api.get_description (contract, part_no), part_no from SHOP_ORD where partition (contract, part_no) like '% xizhilang 25% jelly % '";
OleDbConnection con = new OleDbConnection ("Provider = MSDAORA.1; Password = password; User ID = UserID; Data Source = xf ");
Con. Open ();
OleDbDataAdapter adapter = new OleDbDataAdapter (strCommand, con );
DataSet dataset = new DataSet ();

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.