Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks
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.