WP TutorialLesson 10Free preview
WebPages Databases
This lesson is part of ASP · All levels
Summary
Web Pages can be connected to databases such as SQL Server Compact, SQL Server, or SQLite via WebDatabase. Queries are created with db.Query for SELECT and db.Execute for INSERT, UPDATE, and DELETE. This approach makes it easy for beginners because it's enough to write SQL directly without heavy configuration, provided the parameters are always used to prevent SQL injection.
Key points
- Object db is opened with WebDatabase.OpenConnection("namakoneksi").
- Db.Query is used to SELECT and return the row collection.
- Db.Execute is used for INSERT, UPDATE, and DELETE.
- Use the @name parameter in SQL to be secure from SQL injection.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.