Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users
Protected Sub CountApplications() Dim DBConn As New SqlConnection(ConfigurationManager.ConnectionStrings("JobfairsConnectionString1").ConnectionString) Dim DBCmd As New SqlCommand DBConn.Open() Try DBCmd = New SqlCommand("IF (SELECT COUNT(ApplicantID) FROM Applicants ) > 60 SELECT -1 as error FROM Applicants", DBConn) ' ELSE BEGIN INSERT INTO Applicants (householdIncomeID) VALUES (@ddlHouseholdIncome); Select SCOPE_IDENTITY() End", DBConn) Dim priKey As Integer = DBCmd.ExecuteScalar() If priKey < 0 Then Session("EventTime") = "10/6/2010 12:45:00 AM" Else Session("EventTime") = "10/6/2010 9:45:00 AM" End If Catch exp As Exception Response.Write(exp.Message) End Try 'Close Database connection DBCmd.Dispose() DBConn.Close() DBConn = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.