{"id":2276,"date":"2012-10-22T12:13:45","date_gmt":"2012-10-22T16:13:45","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=2276"},"modified":"2012-10-22T12:13:45","modified_gmt":"2012-10-22T16:13:45","slug":"record-count-using-stored-procedure","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2012\/10\/record-count-using-stored-procedure\/","title":{"rendered":"Record Count Using Stored Procedure"},"content":{"rendered":"<pre>\r\n<code>\r\nImports System.Data.SqlClient\r\nPartial Class mb_app_promo\r\n Inherits System.Web.UI.Page\r\n  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _\r\n                          Handles Me.Load\r\n   G1.Text = \"500\"\r\n   Dim connString As String\r\n   connString = ConfigurationManager.ConnectionStrings(\"myConnString\").ToString\r\n   Dim conn As New SqlConnection(connString)\r\n     Try\r\n       conn.Open()\r\n       Dim cmd As New SqlCommand(\"myStoredProcedure\", conn)\r\n       Dim count As Integer = CInt(cmd.ExecuteScalar())\r\n\r\n       If count >= 500 Then\r\n         Goal1.Text = \"Congratulations - 500 goal!\"\r\n        Else\r\n          Goal1.Text = \"Your current score: \"& count\r\n        End If\r\n\r\n      Catch ex As Exception\r\n         Throw New Exception(ex.Message)\r\n      Finally\r\n         conn.Close()\r\n      End Try\r\n  End Sub\r\nEnd Class<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Imports System.Data.SqlClient Partial Class mb_app_promo Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load G1.Text = &#8220;500&#8221; Dim connString As String connString = ConfigurationManager.ConnectionStrings(&#8220;myConnString&#8221;).ToString Dim conn As New SqlConnection(connString) Try conn.Open() Dim cmd As New SqlCommand(&#8220;myStoredProcedure&#8221;, conn) Dim count As Integer = CInt(cmd.ExecuteScalar()) If count >= 500 Then Goal1.Text [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,17,16,84],"tags":[19,40],"class_list":["post-2276","post","type-post","status-publish","format-standard","hentry","category-net-4-0","category-applications","category-net","category-vs2010","tag-asp-net","tag-count"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2276"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=2276"}],"version-history":[{"count":4,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2276\/revisions"}],"predecessor-version":[{"id":2280,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2276\/revisions\/2280"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=2276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=2276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=2276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}