New feature! Upgrade and increase expert visibility of your issues with Priority Questions.
Shared Function pstcount(ByVal forumname As String) As Results Dim con As New SqlConnection(local) Dim cmd As New SqlCommand cmd.Connection = con cmd.Parameters.AddWithValue("@forumname", forumname) Try con.Open() cmd.CommandText = "Select Count(*) From forum where Forum =@forumname" Dim Res As Results Res.Result1 = cmd.ExecuteScalar() cmd.CommandText = "Select Count(*) From forum where Forum =@forumname and numrep = 0 " Res.Result2 = cmd.ExecuteScalar() cmd.CommandText = "Select TOP 1 title +'|'+ LastPoster +'|'+ CONVERT(VARCHAR(256), lasttime, 120) +'|'+ CAST(ID AS VARCHAR(256)) +'|'+ CAST(numrep AS VARCHAR(256)) from forum where Forum =@forumname order by lasttime DESC" Res.Result3 = cmd.ExecuteScalar() Return (Res) Catch ex As Exception Throw ex Finally con.Close() End Try End Function
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.