tailieunhanh - Visual Basic .NET at Work Building 10 Enterprise Projects phần 10

một cho các nhà cung cấp các dữ liệu và một cho người tiêu dùng. Các chương trình này, bằng văn bản cho phù hợp với một nhà phân phối đồ chơi hư cấu, có thể dễ dàng được sửa đổi để phù hợp với nhu cầu của riêng bạn. | 446 Project 10 Dim conn As New SqlConnection CONNSTR Dim sSQL As String Make sure we are using a valid date. If Now Then You must select a date equal to or _ later than today. Exit Sub End If Prepare our INSERT statement that will save the request. sSQL INSERT INTO VacationRequest EmpID StartDate _ Hours Approved _ VALUES eID _ _ CInt 0 Attemp the INSERT. Dim cmd As New SqlCommand sSQL conn Try Vacation request was successfully _ submitted _ hours . Catch ex As SqlException There was a database error End Try End Sub If the user changes the selection on the calendar we want to make sure it is today or later. If not tell the user. Private Sub calStart_SelectionChanged ByVal sender As ByVal e As Handles Make sure we are using a valid date. If Then You must select a date equal to or _ later than today. Employee Intranet with .NET 447 Else End If End Sub End Class We define our connection string as usual but this time we actually have some class data to store. All the class variables are related to saving the various vacation statistics as well as the employee ID once we load it from the database. Then we handle the page load event. We start it out by retrieving some employee information from the database including the employee ID the first and last names and the amount of vacation the employee is allotted for the year. We ll use these shortly because we need them before we can get any work done. We use standard SQL and to get the information back. Once we .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG