. NET Basics Error Notice 22 points of knowledge

Source: Internet
Author: User
Tags error code rowcount

1:command call a stored procedure, if the output is dataset,selectcommand command object connection first point out, otherwise catch lifetime is empty.

2: The varchar field of the stored procedure if this format is x.x, it is easy to have subtle silly errors, and be careful not to leak [].

3: If the event of the default server control for the ascx file is not rewritten, there is no automatic loopback in the control controls! Remember.

4:page.registeronsubmitstatement use in ascx file ...

5:viewstate a lot of useless data in the state of true ...

6: Clearly understand the sequence of events, such as onsubmit and the difference between the onclick nothing to say ...

7: Pay attention to the relationship between Page_Load and __doPostBack,

8: If on the page dynamically loaded ascx, distinguish Chu Page_Init to perform the operation, do not abuse the user control and custom server controls (emphasis)

The 9:cs file framework needs to be clear, finally integrated, and set to a good version.

10. Use a third party's online editor, preferably with a frame, ok?!

11: Multiple CS File compile time after the source do not add commas on it.

12: In the 5th load of JS can be developed separately, in the onsubmit, because the form is only a lot of ascx,

13: System errors are all marked with the error code (later can be written in the XML document Help document, multilingual version can be shared), this idea is very good.

14: The control itself appears with LoadControl properties that do not recognize page pages, only Inhert modified on page page.

15: Note This stored procedure:

CREATE proc spage
@pagesize int,
@destpage int
as
set nocount on
declare @id int
declare @startid int
  
select @startid = (@destpage - 1)*@pagesize
  
set rowcount @startid
select @id = id from [crm_articler]
  
set rowcount @pagesize
set nocount off
select * from t_member where id > @id order by id
GO

There is nothing to do with the () after execute.

16: Do not try to modify the global variable in the Page_Load, do not have that function.

17: The necessity of the program with uncertain tones did not look.

18: Backstage Use the skill of the frame (Style,js, Class) arrangement is reasonable, as far as possible independently out backstage, does not depend on the foreground part namespace or class.

19: Can be used in this way: using (context = System.Web.HttpContext.Current)

20: As far as possible to compile the output file concise + Independent, function is a module on the compiled into a file, but do not put module (UserControl) and the general release, because UserControl have assembly problems.

21: Disk read XML file is very slow, not always read, you can put into the cache.

22: File read reader, or DataReader must be close ();

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.