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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:27:27+00:00 2026-06-01T08:27:27+00:00

I have already read all the previous similar posts but I couldn’t find a

  • 0

I have already read all the previous similar posts but I couldn’t find a solution. Could you please take a look at my code? I don’t get any exception. I just don’t see the new data in the database.

int admin = 23;

SqlConnection thisConnection = new SqlConnection(
     ConfigurationManager.ConnectionStrings["myconnectionstring"].ConnectionString);

SqlCommand nonqueryCommand = thisConnection.CreateCommand();

thisConnection.Open();

nonqueryCommand.CommandText = 
    "INSERT INTO Account (Username, Password, AdministratorId) VALUES (@username, @password, @admin)";

nonqueryCommand.Parameters.Add("@username", SqlDbType.VarChar, 20);
nonqueryCommand.Parameters["@username"].Value = UsernameTextbox.Text.ToString();
nonqueryCommand.Parameters.Add("@password", SqlDbType.VarChar, 15);
nonqueryCommand.Parameters["@password"].Value = PasswordTextbox.Text.ToString();
nonqueryCommand.Parameters.Add("@admin", SqlDbType.Int);
nonqueryCommand.Parameters["@admin"].Value = admin;

nonquerycommand.ExecuteNonQuery();

thisConnection.Close();
  • 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-06-01T08:27:28+00:00Added an answer on June 1, 2026 at 8:27 am

    I’m not sure if this is a mistake or not, but the ConnectionStrings indexer in the ConfigurationManager is looking for the name of the connection string:

    <connectionStrings>
        <add name="SomeDB" connectionString="..." />
    </connectionStrings>
    
    ConfigurationManager.ConnectionStrings["SomeDB"].ConnectionString
    

    I assume this would’ve caused an error in your code though, perhaps a null reference exception but I don’t remember how that class works.

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

Sidebar

Related Questions

I just want what my title says.I have already read all the previous similar
I have read all the similar question on SO already and none of the
I have read some threads regarding this and I did already take steps to
Basically, I am doing this: I have already read the database and obtained all
I have already read this post , but I am not sure know to
i've already read all topics here and on google about redirection but i'm a
I have already read the sun guide and different similar questions. I want to
Possible Duplicate: What’s with the love of dynamic Languages I have already read this
I have already created a webpart to show the data from list, but I
I have already posted a question about this, but the situation has changed sufficiently

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.