implementation of specific database operationsIn order to implement the operation of the database, we need to define the subclass of the Dboperator class, we take sqldboperator as an example, obviously sqldboperator implement the operation of the SQL Server database.
First, you define a Sqldboperator class that inherits from Dboperator and imports the namespace system. Data. SqlClient.Using System.Data.SqlClient;Class Sqldboperator:dboperator
Second, add private data members Conn,trans,intransa
Tags: des style io ar sp for on Art BSCheck the salary of each department in 25%, 50%, 75% position,Percent_rank () is the relative position in the ranking .CREATE TABLE EMP(EMPNO Number (4) is not NULL,Ename VARCHAR2 (10),JOB VARCHAR2 (9),MGR Number (4),HireDate DATE,SAL number (7,2),COMM number (7,2),DEPTNO Number (2));INSERT INTO EMP (EMPNO, ename, JOB, MGR, HireDate, SAL, COMM, DEPTNO)VALUES (7369, ' SM
, database import and export, etc.
Date type
Overview: In a computer operating system or in a variety of advanced programming languages, dates are usually saved in a long integer, usually in milliseconds
Oracle internally stores date and time information in digital format: century, year, month, day, hour, minute, second
The default date format is Dd-mon-yy. You can use the SysData function to get the current system date and time
Operation: Date-type data can be directly added or minus a val
Using System;
Using System.Collections.Generic;
Using System.Text;
Using System.Data.SqlClient;
Using System.Collections;
Using System.Data;
Summary: Data access Assistant.
Author: Zhiqiao
Date: 2008/07/02
Namespace Zhiqiao.dataaccesshelper
{
The stored procedure call assistant.
public class Storeprocedure
{
The name of the stored procedure.
private string _name;
The database connection string.
private string _constr;
Constructors
sProcName: Stored procedure name;
Constr: Database connection
/xquery/xquery_intro.aspThe XQuery concept is understood to require further understanding of SQL Server support functions for XML, mainly query (), nodes (), exist (), value (), modify (), as detailed in http://msdn.microsoft.com/ Zh-cn/library/ms190798.aspxThere are two ways to implement where in with XML, using value and exist, where the exist method is recommended, as MSDN describes:D. Using the exist () method without using the value () methodvalue() method in a predicate to compare with a r
1. select * from emp;
2. select empno, ename, job from emp;
3. select empno number, ename name, job from emp;
4. select job from emp;
5. select distinct job from emp;
6. select distinct empno, job from emp;Note: Because employee numbers are not repeated, it is proved that all columns are not repeated at this time, so repeated Columns cannot be eliminated.
7. query the employee ID, name, and work, but the displayed format is: 7369 employee, name: smith, and work: clearSelect ':' | empno | 'employ
I believe that the 99 SQL statements are handled, and the basic Oracle test is just like playing (the most comprehensive and most typical entry-level Oracle query statements in history)
1. select * from emp;2. select empno, ename, job from emp;3. select empno number, ename name, job from emp;4. select job from emp;5. select distinct job from emp;6. select distinct empno, job from emp;Note: Because employee numbers are not repeated, it is proved that all columns are not repeated at this time, so
= "select * from tree where uid> @ myid ";Sqlcommand comm = new sqlcommand (SQL, Conn );// Use the add method of the parameters attribute of Comm to define and assign values to the above @ myid Parameter// The sqldbtype class provides the same database type as the sqlserver Data TypeSqlparameter sp = comm. Parameters. Add ("@ myid", sqldbtype. INT );Sp. value =
Windows, you can use WinRAR to import it.
Extract the Directory and copy it to the ADODB directory of the specified directory. For example, I copied it to/comm/ADODB/In the example.3. How to call ADODB?Use include_once ("./comm/ADODB. Inc. php"); isn't that necessary? The main file that contains ADODB.4. How to Use ADODB?1. Perform initialization:ADODB uses a statement such as $ conn = adonewconnection ()
.
Because the annotation writing is more detailed, the following program usually only posts the code.
There are two member variables. One is the SerialPort class provided by C #, which is the ing of physical serial ports in the program.
The other is a variable string type stringbuilder used for string processing.
// Serial private SerialPort comm = new SerialPort (); // variable string class, used to store the received characters private stringbuil
Windows you can use WinRAR to its
Row decompression, after the decompression is completed, copy the directory to the ADODB directory of the specified directory, as I copied it into the/comm/adodb/in the example.
Third, how to invoke ADODB?
Use Include_once ("./comm/adodb/adodb.inc.php"); is that a good line? Contains the ADODB Master file.
Iv. How to use ADODB?
1. To initialize:
ADODB uses $conn = Adonewc
Windows you can use WinRAR to its
Row decompression, after the decompression is completed, copy the directory to the ADODB directory of the specified directory, as I copied it into the/comm/adodb/in the example.
Third, how to invoke ADODB?
Use Include_once ("./comm/adodb/adodb.inc.php"); is that a good line? Contains the ADODB Master file.
Iv. How to use ADODB?
1. To initialize:
ADODB uses $conn = Adonewc
believe that the 99 SQL, Oracle Basic written test is just like playing (the most complete, the most classic entry-level Oracle query statement)1. Select * from EMP;2. Select Empno, ename, job from EMP;3. Select empno number, ename name, job work from EMP;4. Select Job from EMP;5. Select distinct job from EMP;6. Select distinct empno, job from EMP;Description: Because the employee number is not duplicated, it proves that all columns are not duplicated at this time, so duplicate columns cannot be
In the previous query, the result is all records in the table. If you want to only display records that meet certain conditions, you must use conditional query or a restricted query.
Basic Syntax of conditional query:
SELECT * | (specific column names, such as ename and empno)
FROM table (table name)
WHERE conditions
Note: The where clause must be followed by the from clause.
For example, query all information of employees whose salaries are greater than 2000 in the emp table.
SQL> select
is used. For example, the above user login, we can write in this way.SqlHelper classclassSqlHelper {//connecting to a database Static stringConstr ="Data Source=.;i Nitial catalog=db_buiness;integrated security=true"; //main methods of SqlCommand objects//ExecuteNonQuery is used to execute SQL statements and returns the number of rows affected by the SQL statement, typically used to perform commands such as INSERT, Delete, UPDATE, and so on Public Static intExecuteNonQuery (stringSQLText
and 1500: name, salary, sorted by salary from large to small.
7. Information about employees with an annual salary of between 15000 and 20000 is displayed as MANAGER and SALESMAN: name, position, and annual salary.
8. Explain the output results of the following two SQL statements:
Select empno, comm from emp where comm isnull;
Select empno, comm from emp where
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.