'SQL Configuration
Dim SqlCommand As New SqlCommand
SqlCommand.CommandText = "dbo.Property_DeleteProperty"
SqlCommand.CommandType = System.Data.CommandType.StoredProcedure
SqlCommand.Connection = DatabaseConnection
'Parameters
SqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
SqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@PropertyID", System.Data.SqlDbType.Int, 4)).Value = PropertyID
'Connect to DB and fire
SqlCommand.Connection.Open()
Dim ReturnVal As Integer = SqlCommand.ExecuteNonQuery
'Close connection
SqlCommand.Connection.Close()
Return ReturnVal
|