Inserting data into SQL Server database using VB.Net

后端 未结 1 1314
悲哀的现实
悲哀的现实 2021-01-26 13:21

I am currently using HDI Membership provider and the design looks as shown below:

\"enter<

相关标签:
1条回答
  • 2021-01-26 14:02

    Your insert statement is incorrect - since you are not specifying any field names you should be supplying values for all columns.

    The fix is to supply the names of the columns you are insert into.

    The screenshot also shows that there is a required ApplicationName column, so unless it has a DEFAULT defined, you will need to supply that as well.

    Assuming you have a DEFAULT defined on ApplicationName:

    cmd.CommandText = "INSERT INTO Users ( Username, Password, Email, PasswordQuestion, PasswordAnswer) VALUES(@Username,@Password,@Email,@PasswordQuestion,@PasswordAnswer)"
    
    0 讨论(0)
提交回复
热议问题