开发者

check if EndExecuteNonQuery was successful

开发者 https://www.devze.com 2023-01-07 01:45 出处:网络
insComment.EndExecuteNonQuery(); Am trying to insert values into a database. What I need is to know if the code was succesfull then I display a success message.
 insComment.EndExecuteNonQuery();

Am trying to insert values into a database. What I need is to know if the code was succesfull then I display a success message.

if(insComment.EndEx开发者_StackOverflow中文版ecuteNonQuery()){
show some message

}

Is that a workable option?


if the record is successfully inserted, then it will return 1 and you can prompt message accordingly

Should be like...

if(insComment.EndExecuteNonQuery() == 1)
{
  show some message
}
0

精彩评论

暂无评论...
验证码 换一张
取 消