Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6992989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:42:24+00:00 2026-05-27T19:42:24+00:00

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

  • 0

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

enter image description here

Now I am trying to create a new user and insert those values into the database as shown below:

Try
   Dim connectionString As String = "Data Source=.\sqlexpress;Initial Catalog=HDIMembershipProvider;Integrated Security=True"
   Using cn As New SqlConnection(connectionString)
      cn.Open()
      Dim cmd As New SqlCommand()
      cmd.CommandText = "INSERT INTO Users VALUES(@Username,@Password,@Email,@PasswordQuestion,@PasswordAnswer)"

      Dim param1 As New SqlParameter()
      param1.ParameterName = "@Username"
      param1.Value = txtUsername.Text.Trim()
      cmd.Parameters.Add(param1)

      Dim param2 As New SqlParameter()
      param2.ParameterName = "@Password"
      param2.Value = txtPassword.Text.Trim()
      cmd.Parameters.Add(param2)

      Dim param3 As New SqlParameter()
      param3.ParameterName = "@Email"
      param3.Value = txtEmail.Text.Trim()
      cmd.Parameters.Add(param3)

      Dim param4 As New SqlParameter()
      param4.ParameterName = "@PasswordQuestion"
      param4.Value = txtSecurityQuestion.Text.Trim()
      cmd.Parameters.Add(param4)

      Dim param5 As New SqlParameter()
      param5.ParameterName = "@PasswordAnswer"
      param5.Value = txtSecurityAnswer.Text.Trim()
      cmd.Parameters.Add(param5)

      cmd.Connection = cn
      cmd.ExecuteNonQuery()
      cn.Close()
   End Using
   Successlbl.show
   Successlbl.show.Text = "Regisration Success."
Catch
   Errolbl.Show()
   Errolbl.Text = "Your account was not created.Please try again."
End Try

Now the problem is the data is not inserting to the database. I would like to know If anyone can point me where I’m going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:42:24+00:00Added an answer on May 27, 2026 at 7:42 pm

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently using a MySQL database Wanting to insert a new row into a table
I am currently using Ubuntu 11.10 and java SE 1.6.0_26. I am trying to
heres what I'm currently using: Rails -v 3.2.3 I'm trying to make a path
Im currently using codeigniter to build a messaging system and im trying to stay
I am currently using matplotlib.pyplot to create graphs and would like to have the
Currently using Telerik ASP .NET MVC Controls version 2011.2.712 Hello all, I am trying
I am currently using TopShelf with Ninject to create a Windows Service. I have
Currently using Oracle/BEA/Plumtree ALUI Portal 6.1, and am trying to display a client's IP
I`m currently using: <%= f.time_select :day,:default => Time.now, :ampm => true, :minute_step => 15
I am currently using the below function !/bin/bash #Colour change functions fnHotlinkG2R() { sed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.