1. A potentially dangerous Request.Form value was detected
Reason:
(1) The ValidateRequest property is not properly set on the page or webconfig on which the data is submitted
(2) HTML inside wrote two <form> cause
Solve:
Scenario One: Add this sentence to the header of the. aspx file: <%@ Page validaterequest= "false"%>
Programme II: Modification of the Web.config file:
<configuration>
<system.web>
<pages validaterequest= "false"/>
</system.web>
</configuration>
Because the default value of ValidateRequest is true. Just set to false.
2. "Invalid read attempt in the absence of any data" solution
Reason:
The returned SqlDataReader have no data records, but are not treated as a record of judgment. Returns a null value
Plus judgment: if (Reader.read ()) {Textname.text =
reader["FieldName"]. ToString (); }
3. The data is empty. This method or property cannot be called on null values.
Reason:
If the object is null, then the method of invoking the object, such as ToString () is definitely an error, usually the value of the database field is null
Data controls such as Grideview often appear
WORKAROUND: Therefore, null processing is recommended
4. The FieldCount attempt is invalid when the reader closes
Reason:
After using the SqlDataReader to bind the data, the connection object is treated as close ()
Similar
Public SqlDataReader getsomething ()
{
Conn.Open ();
SqlDataReader reader =
sqlcmd. Excecutreader (commandbehavior.closeconnection));
Conn.close ()///occur error here
return reader;
}
This method is called when binding to specify the data source. If you use this method, you need to close the re in the calling function
Ader So conn can be closed automatically.
If you are using SqlDataAdapter and datasets, remove the call that explicitly closes the Conn. or in finally
Called in.
5. Failed to map path
Cause: This may be due to incorrect path configuration in the Webconfig, which is more prominent in FCKeditor configuration
<add key= "Fckeditor:basepath" value= "~/admin/fckeditor/"/>
<add key= "Fckeditor:userfilespath" value= "/userfiles/"/>
6.Unreachable Code detected
Reason:
Typically, the throw or return is used when the exception is handled or returned, possibly in front of it, causing the following code to execute.
Solve:
Put the associated exception-throwing statement (throw) or return statement on the last line of the agent execution.
7. Index out of range. Must be non-negative and less than the collection size
Reason:
(1). DataKeyField set as the corresponding unique field in the database (typically primary key)
(2). Datagrid1.columns > E.item.cells
Solve:
(1). Set DataKeyField
(2). Add Judgment Statement Datagrid1.item.count (DataGrid can be other similar server controls)
8. Error: No part of the path "C:\" was found.
Description
An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.
Exception Details: System.IO.DirectoryNotFoundException: Part of the path "C:\" was not found.
Solve:
In the C disk plus the Users group Read permissions can be accessed, but for the server security issues, users should be removed from the group permissions, successive problems in different ways to display the wrong, such as the problem mentioned below, and then one by one to solve.
9. Data source does not support server-side paging of data
Workaround:
Do not use DataReader, change to use dataset: or use custom paging, do not use the paging functionality provided by vs.net
OleDbDataAdapter da = new OleDbDataAdapter (sql, connection);
DataSet ds2 = new DataSet ();
Da. Fill (DS2, "News");
Gridview1.datasource = DS2;
Gridview1.databind ();
10. The object name ' * * * * is invalid
Reason: There is no * * * * * In the database currently in use, or the current database connection account does not have permission to operate the object
Workaround: Reason 1 Workaround: See if the program has written the name of the table you called or see if there is a workaround in the SQL database for the table reason 2 you called: Change all object owners of your database to dbo.
The solution (this program is from the network, experimentally valid) is as follows:
Use the account you have to connect to Query Analyzer and run the following SQL statement:
You can use Sp_changedbowner to change the owner of the database.
Method One: Right click on the table-the design table, in a row of small icons above, point the last "conditional constraint", point "Table" page, change the owner inside. (If there is no conditional constraint on the small icon, you can right-click, you can see a "check constraint" option)
Method Two: Use script to execute directly, use SYSTEM account or super user to log into this database, then execute the following statement:
sp_configure ' allow updates ', ' 1 ' Go reconfigure with override go update sysobjects set uid=1 where uid<>1 go sp_conf Igure ' Allow updates ', ' 0 ' go reconfigure WITH override/* Bulk replacement
Declare TB cursor Local for select ' Sp_changeobjectowner ' [' +replace (USER_NAME (UID, '] ', ']] + ']. [' +replace (Name, '] ', ']] + '] ', ' dbo ' from sysobjects where xtype in (' U ', ' V ', ' P ', ' TR ', ' FN ', ' IF ', ' TF ') and status>=0 open TB declare @s nvarcha R (4000) fetch TB into @s while @ @fetch_status =0 begin EXEC (@s) fetch TB to @s end close TB deallocate TB Go
*/
11. An error occurred while establishing a connection to the server. When connecting to SQL Server 2005, the default settings for SQL
This failure may be caused by the Server not allowing remote connections. (provider: Named pipe provider,
ERROR:40-Unable to open connection to SQL Server
Solution: A fixed IP address or server address is required on the host
12.SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 pm.
This problem occurs ' mostly because you update the database ' DateTime field value is empty ' by default insert January 01 01
Day ' ' causes datetime type Overflow
13. The appearance of the-------represents "properties", where the "method" should be
Reason:
1.VB method with C #, the format of the property is different.
2. It is possible that the syntax for binding data in design is incorrectly resolved: 1. Remember that attributes are used with the [] method ()
2. Remember the correct syntax for binding data (in several ways:: <%container.dataitem ("field name")%> <%
#Eval ("field name")%> <%bind ("field name")%>, etc.)
14. Failed from the Assembly "DAL, version=1.0.0.0, Culture=neutral,
Publickeytoken=null the "load type" DAL. SqlHelper ".
Reason: Failed to recompile to DLL after other layers have been modified
Resolution: Compile (Rebuild)
15. Too many parameters are specified for a procedure or function.
Solution: The number of parameters used to invoke stored procedures with defined stored procedures or the incoming arguments in the executed SQL statement
Inconsistent number of numbers (this is a SQL error)
Solution: Carefully examine the parameter variables that are set in the stored procedure and correspond to the actual input parameter values of one by one
16. Unable to start debugging, invalid binding handle
Cause: The system's Terminal Services are not open
17.Unable to debugging on the Web server. Debug failed because Integrated Windows authentication is not enable
Workaround:
Open the Vs2005-> tool (Tools)-> option-> Debugging (Debugging)-> Edit and Continue (Edit and Continue)-> all tick
file name or class name not found in 18.Automation operation: ' RegExp '
Workaround: regsvr32 vbscript.dll
19.system.nullreferenceexception: Object references are not set to an instance of an object.
Reason:
(1) The variable being set is NULL or does not have a value, typically occurs when passing parameters, and also occurs when using data controls such as the DataGrid or GridView or DataList.
(2) The control name does not correspond to the codebehind inside
(3) Initialization of object not with new
(4) The control referenced in the program does not exist
Workaround:
(1) Use Try ... Catch...finally catch the error, or output the variable value directly with Response.Write ()
(2) To see if there are any uninitialized variables in the code
20. Error 1718. File is rejected by digital signature policy (when installing VS2005SP1) Workaround:
(1). Click Start, click Run, type Control AdminTools, and then click OK.
(2). Double-click Local Security Policy.
(3). Click Software Restriction Policy. (Note: If the software restrictions are not listed, right-click Software restriction Policies, and then click New Policy.) )
(4). Under Object type, double-click coercion.
(5). Click All users except local administrators, and then click OK.
(6). Restart the computer.
Microsoft notes:
http://support.microsoft.com/kb/925336