如何将c#生成的随机数保存到数据库 [英] How Do I Save a c# Generated Random number To Database

查看:198
本文介绍了如何将c#生成的随机数保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


$ b $我正在尝试开发密码恢复系统,当用户点击忘记密码链接时,它会生成一个随机数用户的电子邮件和用户得到验证。



i已成功编写c#中的代码,生成随机数并将其发送到用户的电子邮件但我现在正在尝试计算如何保存生成到数据库中的随机数。



提前谢谢

Hello,

i am trying to develop a password recovery system, where when the user click on the "forgot you password" link, it generates a random number to the user's email and the user gets verified.

i have successfully written the code in c# that generates the random number and sends it to the user's email but am now trying to figure out how to save the random number that was generated into the database.

Thanks in advance

推荐答案

使用sql insert,参考:

使用参数化查询
[ ^ ]
Use sql insert, refer:
Using Parameterized queries
[^]


这篇关于如何将c#生成的随机数保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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