- 分享
- 0
- 人气
- 0
- 主题
- 7
- 帖子
- 703
- UID
- 72608
- 积分
- 1098
- 阅读权限
- 18
- 注册时间
- 2007-4-14
- 最后登录
- 2017-6-12
- 在线时间
- 826 小时
|
username = CreateUserWizard1.UserName.ToString
password = CreateUserWizard1.Password.ToString
email = CreateUserWizard1.Email.ToString
securityquestion = CreateUserWizard1.Question.ToString
securityanswer = CreateUserWizard1.Answer.ToString
Conn = Server.CreateObject("ADODB.Connection")
strConn = "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\Users\User\Desktop\User_Data.mdf.sdf"
strQuery = "declare @username nvarchar(100)"
strQuery = "set @Username=CreateUserWizard1.UserName.ToString"
Conn.Mode = 3
Conn.Open(strConn)
strQuery = "insert into UserRecord VALUES ( '9','@username', 'password', 'email', 'securityquestion','securityanswer'); "
Conn.Execute(strQuery)
小弟我有点问题,我是要用asp.net中的variable带入sql insert into query,我这样写对吗? |
|