Displaying Graphs with an Object Oriented Approach using Silverlight SDK and Visual Studio 2008 - Understanding the ASP.NET 3.5 Web Service
(Page 2 of 5 )
To connect to the database, the connection string is embedded as part of “web.config” as follows:
<connectionStrings>
<add name="cnNorthwind" connectionString="Data Source=.\sql2k5;initial catalog=Northwind;user id=sa;password=eXpress2005"/>
</connectionStrings>
To hold one row of the “Products” table, an entity class named “Product.vb” is developed as follows:
Public Class Product
Private _ProductID As Integer
Private _ProductName As String
Private _UnitPrice As Double
Private _UnitsInStock As Integer
Private _UnitsOnOrder As Integer
Private _SaleTillToDate As Integer
Public Property ProductID() As Integer
Get
Return _ProductID
End Get
Set(ByVal value As Integer)
_ProductID = value
End Set
End Property
Public Property ProductName() As String
Get
Return _ProductName
End Get
Set(ByVal value As String)
_ProductName = value
End Set
End Property
Public Property UnitPrice() As Double
Get
Return _UnitPrice
End Get
Set(ByVal value As Double)
_UnitPrice = value
End Set
End Property
Public Property UnitsInStock() As Integer
Get
Return _UnitsInStock
End Get
Set(ByVal value As Integer)
_UnitsInStock = value
End Set
End Property
Public Property UnitsOnOrder() As Integer
Get
Return _UnitsOnOrder
End Get
Set(ByVal value As Integer)
_UnitsOnOrder = value
End Set
End Property
Public Property SaleTillToDate() As Integer
Get
Return _SaleTillToDate
End Get
Set(ByVal value As Integer)
_SaleTillToDate = value
End Set
End Property
End Class
Next: Understanding the ASP.NET 3.5 Web Service: continued >>
More ASP.NET Articles
More By Jagadish Chaterjee