成功注册后,我想要另一个将显示已成功插入数据的网页 [英] After successful sign up i want another web page which will display successful data inserted

查看:73
本文介绍了成功注册后,我想要另一个将显示已成功插入数据的网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

成功注册后,我想要另一个将显示成功插入数据的网页..小代码将执行cmd.ExecuteNonQuery()和conn.Close( )

After successful sign up i want another web page which will display successful data inserted..small code that will excute to show that the data u inserted is successful on nxt web page after excuting cmd.ExecuteNonQuery() and conn.Close()

推荐答案

ExecuteNonQuery对连接执行Transact-SQL语句,并返回受影响的行数.因此,您可以将此计数显示给用户,以告知用户插入成功.
ExecuteNonQuery executes a Transact-SQL statement against the connection and returns the number of rows affected. So you can show this count to the user to inform him that the insert was successful.


请尝试以下操作:

try this:

int i=cmd.ExecuteNonQuery();

if(i>0)
{
 Response.Redirect("success.aspx");//successful data inserted message in this page.
}



希望这会有所帮助:)



hope this helps :)


这篇关于成功注册后,我想要另一个将显示已成功插入数据的网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆