Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim con As SqlConnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=DB;User ID=test;Password=test")
- Dim da As New SqlDataAdapter
- Dim cmd As New SqlCommand("getDates", con)
- Dim par As New SqlParameter
- Dim ds As New DataSet
- da.SelectCommand = cmd
- con.Open()
- Try
- cmd.CommandType = CommandType.StoredProcedure
- cmd.Parameters.Add("@PlaceID", SqlDbType.Int)
- cmd.Parameters("@PlaceID").Value = 39
- da.Fill(ds)
- Finally
- If cmd IsNot Nothing Then cmd.Dispose()
- If con IsNot Nothing AndAlso con.State <> ConnectionState.Closed Then con.Close()
- End Try
- messageLabel2.Text = ds.Tables(0).Rows.Count.ToString
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement