This article shares a piece of database code in asp.net. If you need it, refer to this article.
The Code is as follows:
Copy code
Using System;Using System. Data;Using System. Configuration;Using System. Web;Using System. Web.
'// Determine whether the page tag is included in the contentIf instr (cinfo, "[NextPage]")> 0 thenFlag = 1ElseFlag = 0End if'// Set parameters'// JS package letter'// Text display '// The following is the JS text processing function.Function
Transferred from: http://www.cnblogs.com/hackhu/archive/2007/11/27/974135.htmlIn the BETA2,. NET provides the following namespace:System.Data NamespaceSystem.Data.OleDb (and BETA1 has been different, so if you take BETA1 in the program to the BETA2
Last time I talked about how to do this in ADO. . NET to execute the SELECT statement. This time, we will look at how to execute the statements such as DELETE, UPDATE, and INSERT.We can also see through examples this time, in which we use the System.
When I download an object today, I found that the object name should be retrieved from a field in the database, and this field does not guarantee that invalid characters will not be used, such \/:*? "<> |
I wrote a simple method for replacement. The
The code is as follows
Copy Code
Using System;Using System.Data;Using System.Configuration;Using System.Web;Using System.Web.Security;Using System.Web.UI;Using System.Web.UI.WebControls;Using System.Web.UI.WebControls.WebParts;Using
1, practice using the Request object to accept the data and use a combination of functions.
Cnbruce.html
Cnbruce.asp
function th (str)Str=replace (str, "damn", "MD")Str=replace (str, "lean", "KAO")Th=strEnd
Copy Code code as follows:
Using System;
Using System.Data;
Using System.Configuration;
Using System.Web;
Using System.Web.Security;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.WebControls.WebParts;
Using
This is a simple security filtering function that converts HTML conversion characters into text that can be displayed.
Function HtmlDecode (restring)Dim str:str=restringIf not IsNull (STR) Thenstr = Replace (str, "", "&")str = Replace (str, ">",
Note: The seajs version used in this article is 2.1.1.1. encapsulate Jquery into a seajs ModuleCopy codeThe Code is as follows: define (function (){
// Put the jquery code here and put your favorite jquery version in.
Return $. noConflict
The regular expression can be:• Test a mode of a string. For example, you can test an input string to see if there is a phone number or a credit card number. This is called Data Validity verification.
• Replace text. You can use a regular expression
Preventing SQL injection is a problem that every developer must take an exam.
Asp.net has a global. asax file and has an application_beginrequest method (obtained by the application startup)
This is the event triggered when the parameters are
The code is as follows
Copy Code
Class Stringoperations ''**************************************************************************** "' @ Feature Description: Swap string for char-type array ' @ parameter Description:-str [string]
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.