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 6997175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:15:01+00:00 2026-05-27T20:15:01+00:00

This is my app.config file looks like: <?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add

  • 0

This is my app.config file looks like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
      <add key="Application Name" value="/MyApplication" />
    </appSettings>
  <connectionStrings>
     <add name="frmStartup.My.MySettings.HDIMembershipProviderConnectionString"
        connectionString="Data Source=.\sqlexpress;Initial Catalog=HDIMembershipProvider;Integrated Security=True"
        providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <membership defaultProvider="HDIMembershipProvider">
      <providers>
        <clear/>
        <add name="HDIMembershipProvider" type="MyApplication.HDIMembershipProvider, MyApplication"/>
      </providers>
    </membership>
  </system.web>
    <system.diagnostics>
        <sources>
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                <listeners>
                    <add name="FileLog"/>
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
                </listeners>
            </source>
        </sources>
        <switches>
            <add name="DefaultSwitch" value="Information" />
        </switches>
        <sharedListeners>
            <add name="FileLog"
                 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" 
                 initializeData="FileLogWriter"/>
            <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
        </sharedListeners>
    </system.diagnostics>
</configuration>

I am trying to use HDI membership provider and this is my Users table structure:

enter image description here

And in my recent question asked here Oded helped me out trying to figure the problem with my Insert statement and I re-modified it and I have an ApplicationName column in my database structure I need to specify it.(As it should not be null value)

Now I need to add my application name by default to enter to database as we do it for web.config.

This is what I mean.

enter image description here

I need to add that MyApplication to my app.config file.

So How do I do that?

This is how I’m trying to enter user details to database but it is not enetering a single value

 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 ( Username, Password, Email, PasswordQuestion, PasswordAnswer) 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

Can anyone point me out where I’m making mistake.

And this is the final result I’m getting while entering to database:

enter image description here

To be more short and clear I need to enter the above shown User details to my database using the HDI membership provider.

  • 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-27T20:15:02+00:00Added an answer on May 27, 2026 at 8:15 pm

    I have figured out the problem Myself after a lot of hair pulling and found the solution that I have changed my code in this way:

     cmd.CommandText = "INSERT INTO Users ( Username,ApplicationName,Password, 
        Email, PasswordQuestion, PasswordAnswer) VALUES(@Username,@ApplicationName,@Password,
        @Email,@PasswordQuestion,@PasswordAnswer)"
    

    And add another Param this way:

     Dim param6 As New SqlParameter()
     param6.ParameterName = "@ApplicationName"
     param6.Value = txtApplicationName.Text.Trim()
     cmd.Parameters.Add(param6)
    

    I know this not the best way If anyone found any other best solution let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application config file that looks something like this: database: type: [db-type]
I am building a console Qt project. Currently, my project file looks like this:
So I have this App in the store, and I would like to release
I have a WCF service application and in this app I am doing calls
Hey. I want to have a config.xml file for settings in a Python web
When the users of this app make changes to the fields a large amount
So I have this app which needs to query entities from the Azure Tables
[edit] I am NOT using jquery in this app. Looking for a way to
I've been beating myself over the head with this app migration for a few
Why isn't this project maintained anymore? I love this app, however not updating it

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.