How to use single line if statement that reduce the number of lines of code for these kind of coding
if (string.IsNullOrEmpty(txtpictext.Text))
{
Cmd.Parameters.AddWithValue("@pictext", DBNull.Value);
}
else
{
Cmd.Parameters.AddWithValue("@pictext, txtpictext.Text);
}
Conn.Open();
Cmd.ExecuteNonQuery();
Aucun commentaire:
Enregistrer un commentaire