C # project Development Revelation (Genesis new article)

Source: Internet
Author: User

The webmaster will go to Java development next month, after the C # touch less, usually some experience in OneNote, now collected and collated, because can only use the handover work soy sauce time, ...

  

C # Development:

1, the target platform choice : The three-bit operating system when compiling VS program, according to the need to set the project properties of the "target platform" for x86. If set to AnyCPU, there is no "edit and Continue" in VS 2005.


both x86 and anycpu can be used on 32-bit operating systems.

--Selecting x86 to run on a 64-bit server may cause problems with the class library not loading. This issue is explained in the following IIS experience.

2, take the DataTable or DataGridView inside the value of two common methods:

The former needs to be taken from value , which is not very convenient to use. the latter and cannot add Value.

--All the brackets can use the ordinal (starting from 0) or the field name (column name, row name)

3. If you do not use LINQ (the 2.0 framework that is used all the time ...). ), you can use this method to write execution SQL. such as:

string strSQL = string. Format ("Insert table_1 values (' {0} ', ' {1} ', {2},{3})"

If it is a varchar type, it must be used, if it is an int, it is found that both can be used ' or not used, often write scripts, too troublesome, all with the ' ', seemingly implementation of the problem, but do not know that performance will be reduced. If you know a friend, please say it in the comment section.

--a friend commented that it was prone to being injected into an attack. Check out the method of avoiding injection attacks: 1, using Stored procedures, 2, parameterized SQL statements.

--Here's how to use parameterized SQL statements:

4,DLL Reference, but in the code is still unable to call.

try to set the property inside the DLL to use a specific version of False.

5, the method in the class library when called, How to let the method above show the custom description?

tick the item: Properties--Generate--xml document file

When using a class library, the corresponding XML is also copied to the same directory, which will see a custom description of the class library function in VS. The premise is that the code uses "///" to generate comments.

6, Bo Friends share: VS2010 in the new. NET 4.0 project, often default to a clent profile, often problems ... Switch to the standard frame.

VS2005 There is no such problem, VS2013 does not seem to exist.

7. Failed to load Assembly

The scope of this problem is too large, can cause this problem is a lot of reasons, I remember the more scattered, later found a succession of additions.

--version mismatch.

--whether the class library generates x86 or x64 or ANYCPU, it is best to be able to align the target platform.

--Two project reference paths are different, or a path is generated differently.

SQL Article

1. Questions about join in SQL.

when the left join table (child table), on the field exists two, then the results of the query will be divided into two.

-so the control of the sub-table content is not accurate, it is likely to query out the results of non-compliance.

Example:

(1) The contents of two tables are

such as convert. Note Using UNION ALL can significantly increase the speed so that the query results are not sorted.

Ideas and Design concepts:

1. The concept of logical deletion and physical deletion?

The physical deletion is actually deleted, and the tombstone retains the location of the data in the database, but modifies its delete flag as deleted (it looks like this is learning in college ...). )

2, in the UI layer (user interface), if something goes wrong, or the operation fails, you should remind the user what to do next.

For example: When the user takes action B, the option A must be turned on. Set the current option A to off, and the user to action B, you should be prompted: "The operation failed, option A is not enabled, please turn on option A in the XXX settings." In some applications, you can even increase the direct jump to settings, or modify the settings directly. It depends on the need.

That,all right.

David He essay



C # project Development Revelation (Genesis new 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.