1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Public Shared Sub UpdateNouvellesItem(ByVal ItemID As Integer, ByVal CategorieID As Integer, ByVal Titre As String, ByVal SousTitre As String, ByVal BodyText As String)
Using connection As New SqlConnection(WebConfigurationManager.ConnectionStrings("TimesConnectionString").ConnectionString)
Dim command As New SqlCommand("proc_UpdateNouvellesItem", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@ItemID", SqlDbType.Int).Value = ItemID
command.Parameters.Add("@CategorieID", SqlDbType.Int).Value = CategorieID
command.Parameters.Add("@Titre", SqlDbType.VarChar, 128).Value = Titre
command.Parameters.Add("@Soustitre", SqlDbType.VarChar, 512).Value = SousTitre
'command.Parameters.Add("@BodyText", SqlDbType.Text).Value = BodyText
'command.Parameters.Add("@BodyText", SqlDbType.Text).Value = String.IsNullOrEmpty(BodyText)
Try
connection.Open()
command.ExecuteNonQuery()
Finally
If connection IsNot Nothing Then
connection.Close()
End If
End Try
End Using
End Sub |
Partager