Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP.NET Web Pages Database Reference

ASP.NET Web Pages - Database Object

ASP.NET Database Object Reference


Method Description
Database.Execute(SQLstatement [*, *parameters]) Executes an SQL statement *SQLstatement* (with optional parameters), such as INSERT, DELETE, or UPDATE, and returns the count of affected records.
Database.GetLastInsertId() Returns the identity column of the most recently inserted row.
Database.Open(filename)
Database.Open(connectionStringName) Use Web.config Opens the specified database file or specified database using the connection string in the file.
Database.OpenConnectionString(connectionString) Opens a database using a connection string. (The difference from Database.Open is that Database.Open uses the name of the connection string, whose value is configured elsewhere.)
Database.Query(SQLstatement[, parameters]) Uses an SQL statement SQLstatement(with optional parameters) to query the database and return the result set.
Database.QuerySingle(SQLstatement [, parameters]) Executes an SQL statement SQLstatement(with optional parameters) and returns a single record.
Database.QueryValue(SQLstatement [, parameters]) Executes an SQL statement SQLstatement(with optional parameters) and returns a single value.