C#. NET development common exception handling based on Oracle database system

Source: Internet
Author: User
Tags date exception handling execution reference string format oracle database
oracle| Data | database | exception handling

Note: First step debugging, find the Error program statement
<1> unregistered xxx dynamic link library
(The dynamic link library file is not registered or the class library where the method is located does not exist)

<2> does not refer object settings to object instances
(The object is not assigned correctly, the value of the parameter can be examined, and an uninitialized variable is referenced )

<3> "MyDelegate" is an ambiguous reference
(a delegate with the same name appears on the same-level namespace node)

<4> does not support parallel transactions
(New transaction uncommitted or incomplete transaction execution, note that if a return statement exists before the transaction is committed, then the transaction commit must be executed before the turn)

<5>ora: The expected from keyword could not be found
(keyword conflict in SQL statement)
(The from front character does not retain spaces)

<6> string format mismatch
(An integer type parameter application in Oracle can be replaced with a string, but the varchar type parameter must correspond to a string type in the application)
(parameter conversions are incorrect, parameter types do not match data table Type field types)

<7> missing expression/expected keyword not found from
(SQL statement error)
(You can view the execution of a variable with a quick Watch method)
(The AS keyword cannot be used in Oracle to give table aliases, remove as)
(conversion error, for example, char should be to_char, please refer to related Oracle Technical material for details)

The <7>sql command did not end correctly
(missing parentheses or other identifiers)

<8>current TIMESTAMP
(1) Instead: Current_timestamp, you can
(2) Table alias only: SELECT * FROM TableName A can not write: SELECT * FROM TableName as a
(3) To_char (char), to_number (int), to_date (date)

<9>dual replaces the sysibm.sysdummy1 in the IDM DB2 with to_date instead of timestamp
When you specify a data source for a combo box, place the data source in the front, such as CMB. DataSource = DataSource; Cmb. Displaynumber = ...
<10> error calling stored procedure, number of arguments or type error
(check the parameter name, value, type, length, outgoing direction and stored procedure parameters are consistent, must be carefully checked, or maybe a mistake, all wrong.) I have encountered once, 36 parameters to pass in the stored procedure, only because of a parameter name error, the result of the system always prompts the above exception.

<11> Execute stored procedure, the inserted column is too large!
(parameter length is too small, or the quoted string does not remove spaces)
<12> add n an hour to Current_timestamp
Select Current_timestamp + n/24 from dual

<12> to the combo box to specify the data source, all properties are normal, but is not normal display!

  for more details:                                                                                                                                                          
<13> Lack of due reference and assembly, strange, I obviously added it?
(1) System internal error, turn off the development environment, restart can!
(2) The reference name has a capitalization error!

<14> "Control" is an ambiguous reference
(1) The class with the same name appears under the name space of the system perception. For example: System.Windows.Forms.TextBox, Mytest.textbox
(2) Specify the name space in detail, can not be referenced by the textbox, because the system does not know what you are referring to the textbox

<15> date format The picture ends before converting the entire input string
(1) This is usually because of such statements in the program: Cast (Djrq as char (10)) | | ''|| Cast (DJSJ as char (10))
(2) should read: To_date (To_char (DJRQ, ' yyyy-mm-dd ') | | '|| To_char (DJSJ, ' hh24:mi:ss '), ' Yyyy-mm-dd hh24:mi:ss ')

<16> service names that cannot be processed
(1) This is usually due to a connection string error, or an error in the folder name where the application resides, resulting in the inability to log on to the Oracle server.
For example, if a folder is named AAA (DD), and so on, names with non-alphanumeric and numeric combinations will be specially noted for this exception.




Related Article

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.