Learning Objective: Learn to add remove modify the record
ASP in the past, whether we add or delete records or to use SQL statements with EXECUTE () or is directly RECORDSET of NEW, DELETE, UPDATE and other methods to add delete modify records. Which we use in ASP.NET with SQL statement object to execute SQL statements COMMAND way to add delete modify records. This is up from that record is also easy to read. Actually only one difference, the ExecuteReader () was revised to ExecuteNonQuery () can, because we do not need the return value ah.
string strConnection = "Provider = Microsoft.Jet.OleDb.4.0; Data Source =";
strConnection + = Server.MapPath (strDb);
OleDbConnection objConnection = new OleDbConnection (strConnection);
OleDbCommand objCommand = new OleDbCommand ("Here is the SQL statement", objConnection);
objConnection.Open ();
OleDbDataReader objDataReader = objCommand.ExecuteNonQuery ();
-----------------------
dim objConnection as OleDbConnection
dim objCommand as OleDbCommand
objConnection = new OleDbConnection (Provider = Microsoft.Jet.OleDb.4.0; Data Source = "+ Server.MapPath (strDb))
objCommand = new OleDbCommand ("Here is the SQL statement", objConnection)
objConnection.Open ()
objDataReader = objCommand.ExecuteNoQuery ()
Cite the following examples illustrate the SQL statement (ACCESS):
Add record: insert int
o table name (field 1, field 2) values (string 1, string 2) where the conditions
Delete records: delete from table name where conditions
Modify the record: update table name set field 1 = 脳 脳, field 2 = 脳 脳 where conditions
Require special attention, if it is to delete record delete Sql Server table name, do not need to add from the.
Here today, tomorrow, said inside the most famous ASP.NET DATAGRID.
相关链接:
Reviews Seasonal - Screen Savers
Directory Web Development
AMD expects Q4 REVENUE to fall about 25%
Terminal promotion on doing SOME of the views
Telnet in RHEL 5 on the OPENING process
comparison Personal Finance
Correctly UNDERSTAND the IPD of the "structured process"
Younger's Quickstep
M2TS to MKV
Easy Food And Drink
Photoshop Rendering Realistic Beautiful Necklace
The Rise Of Domestic Erp Market Share In 2010
MKV to VOB
Cool I am a LEADING online high quality music box
Flash to MPEG
TMPGEnc --- MPEG Compression King
INSURANCE Goes to focus on risks and preventive measures