Bug set [updating]

Source: Internet
Author: User

<1> gridview "gridview1" triggers the unprocessed event "rowdeleting"
Exception details:System. Web. httpexception: The gridview "gridview1" triggers the unprocessed event "rowdeleting ".
Cause analysis:
The delete confirmation dialog box is displayed in the gridview1 event. Therefore, when you click Delete, The rowcommand event is executed, that is, the delete operation is performed, then the rowdeleting event is triggered, but the event is not defined in the Code, so an error occurs.

 <2> sqlexception: the timeout has reached. The timeout has expired or the server has not responded before the operation is completed.
Exception information:
Exception type: sqlexception
Exception message: the timeout has reached. The timeout has expired or the server has not responded before the operation is completed. Data Connection timeout.
Cause analysis:
<1> the database is being backed up.
<2> the timeout time set by the database is too short.
<3> the connection obtained in the program is not released in time.

<4> the transaction in the program does not have commit or rallback.

When using transactions, you must control the transaction load. If a transaction, including querying, computing, and updating multiple tables, involves some batch processing operations, although transactions can ensure data integrity and consistency, this overload of transactions poses a serious challenge to the database. In this case, it is easy to produce deadlocks and reduce system performance.

<3> the callback parameter is invalid.

Use <pages enableeventvalidation = "true"/> in the configuration, or use <% @ page enableeventvalidation = "true" %> On the page to enable event verification.

For security purposes, this function verifies whether the parameters of the send-back or callback events come from the server controls that initially present these events. If the data is valid and is expected, use the clientscriptmanager. registerforeventvalidation method to register the sending back or callback data for verification.

<Asp: templatefield headertext = "operation">
<Itemtemplate>
<Asp: linkbutton id = "lbtndelete" runat = "server" commandname = "delete" commandargument = '<% # eval ("f_id ") %> 'onclientclick = "Return confirm ('Are you sure you want to delete it? ') "> [Delete] </ASP: linkbutton> </TD>
</Itemtemplate>
</ASP: templatefield>

Solution:
1) You can change the value of the commandname attribute (the original value is "delete") of the delete button to not "delete", for example, to "Del ";
2) or you add a rowdeleting event. The code in this event is empty.

<4> unable to attach. The binding handle is invalid.

The following error is prompted when you debug the program:

After my own thinking and analysis, I feel that some necessary services may be stopped when I use the optimization master, because there was no such problem before. Then I searched Google and finally found the problem.

Solution: start the service:Terminal Services

 

<5> dalfactory displays "failed to Load file, assembly" league. sqlserverdal ", or one of its dependencies. The system cannot find the specified file.

In fact, the error is obvious, that is, the file legou. sqlserverdal. dll cannot be found, mainly because the DLL we generated is sqlserverdal. dll.

  Solution:
Set the Assembly name in the properties of the project to league. sqlserverdal to generate DLL files such as league. sqlserverdal. dll.

 

<6> the system prompts that the application "webdev. webserver. EXE" cannot be applied, and a debug is attached.
Close the solution, open it again, and debug it.

Cause: the page uses form nesting. Is there only one form?

<7> the sending back or callback parameters are invalid.

Use <pages enableeventvalidation = "true"/> in the configuration, or use <% @ page enableeventvalidation = "true" %> On the page to enable event verification. For security purposes, this function verifies whether the parameters of the send-back or callback events come from the server controls that initially present these events. If the data is valid and is expected, use the clientscriptmanager. registerforeventvalidation method to register the sending back or callback data for verification.

    

Problem:

First, form nesting. A page can only have one form. You can solve this problem by checking the code carefully.
Second, Ajax is used in the drop-down menu, which is common in the provincial/municipal linkage menu. It may be because the initial item value of the drop-down menu is assigned to the ASPX page. This error is prompted when the event is returned, delete the initial item value from the drop-down menu and add the item to the binding event.

<8> the repeater event is invalid. When you click yes, the event is not triggered.
Similar:

Protected void repeaterincluitemcommand (Object source, system. Web. UI. webcontrols. repeatercommandeventargs E)
{
// Do something
}

  Solution: Set enableviewstate of repeater to true.

<9> sqldbtype. Text length limit.

Because an article needs to be stored, sqldbtype. Text is used. However, when adding an article, the content always fails to be added. At last, we found that it was originally sqldbtype. Text length limit.

New sqlparameter ("@ f_content", sqldbtype. Text, 16)

With this restriction, the article can only intercept 16 strings. But the length cannot be entered.

Solution:

1. Size: it can be set based on your own situation, or you do not need to set it. However, it is necessary to check the input length.

2. Use nvarchar or varchar instead. If the article is not long enough, consider the two types.

 

Varchar, nvarchar, and text features and differences

Varchar [(n)]

Variable-length and non-UNICODE character data with a length of n Bytes. N must be a value between 1 and 8,000. The storage size is the actual length of the input data bytes, rather than n Bytes.

Nvarchar (N)

Unicode data with a variable length of n characters. The value of N must be between 1 and 4,000. The storage size of bytes is twice the number of input characters. The length of the input data can be zero.

Text

The variable-length non-Unicode data in the server code page can contain a maximum of 231-1 (2,147,483,647) characters. When the server code page uses double-byte characters, the storage volume is still 2,147,483,647 bytes. The storage size may be less than 2,147,483,647 bytes (depending on the string ).

<10> execute JS and the page style is messy.

Response. Write ("<script language = 'javascript '> alert ('" + message + "'); </SCRIPT> ");

Sometimes you need to execute JS statements in CS, such as error prompts and page jumps. However, this problem often occurs. After the statement is executed, the displayed page is messy, and the previous CSS is not used.

The reason is: when response. when the write method is used, some code is output to the page. You can view the source code of the messy page and find that there is a piece of JS Code at the top of the page, which is response. write method result.

Correct method:

Page. clientscript. registerclientscriptblock (page. getType (), "message", "<script language = 'javascript '> alert ('" + message + "'); </SCRIPT> ");

 

The command causes the page to execute this JS Code, which appears after the <form> mark. During running, the page will not be messy.

<11> replace invalid strings have returned values. Remember. String S = "Hello the world! "; S. Replace (" hello "," Hello sir "); // It won't change itself. Correct: S = S. Replace ("hello", "Hello sir ");

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.