CRUD
On the sample built in the previous section, let us implement the basic operations (Read, Create, Update, and Delete). You will also learn how to link the results to particular elements of the UI, as well as a succinct introduction to error control.
Read
Let us see how to read data. In this case, we will focus on the necessary code to perform this operation and leave aside things such as linking information to controls. This sample reads from the database and shows a series of message boxes, one for every read message.
Let us begin by opening the Code-Behind
Mainpage.cs
file. Add theusing
namespace containing our context. When searching in the fileSilmpleDB.Web.g.cs
, under the hidden folder Generated_Code, it can be seen that the space is SimpleDB.Web (In the following section, you will see how to get this out of the web project). It is also necessary to add an RIA Services reference, namely,System.ServiceModel.DomainServices.Client
using the following code:using System.ServiceModel...