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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:51:07+00:00 2026-06-05T15:51:07+00:00

Am building window form application for a clinic using VS2010. On the form in

  • 0

Am building window form application for a clinic using VS2010.
On the form in have a searchbutton that display data baseon the RegistrationNo.
When i test the application, provide the Registration number and click the search
button nothing is display, and no error message is display too.
Here is my code

        string connectionstring = "Data Source=localhost;Initial Catalog=HMS;Persist Security Info=True;User ID=Developer;Password=abc@123";
        SqlConnection connection = new SqlConnection(connectionstring);

        string SelectStatement = "SELECT * FROM MyTable where RegistrationNo = '@RegistraionNo'";
        SqlCommand insertcommand = new SqlCommand(SelectStatement, connection);
        insertcommand.Parameters.AddWithValue("@RegistrationNo", txtsearch.Text);
        SqlDataReader reader;
        try
        {
            connection.Open();
            reader = insertcommand.ExecuteReader();

            while (reader.Read())
            {
                textBox3.Text = reader["RegistratioNo"].ToString();
                textBox1.Text = reader["FirstName"].ToString();
                textBox2.Text = reader["LastName"].ToString();
                genderOption.Text = reader["Sex"].ToString();
                textBox7.Text = reader["Contact"].ToString();
                textBox4.Text = reader["Age"].ToString();
                textBox5.Text = reader["Weight"].ToString();
                textBox6.Text = reader["Weight"].ToString();
                comboBox1.Text = reader["Tribe"].ToString();

            }//end while
            reader.Close();
        }
        catch (SqlException ex)
        {
            throw ex;

        }//end catch
        finally
        {
            connection.Close();
        }// end finally

`

  • 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-05T15:51:08+00:00Added an answer on June 5, 2026 at 3:51 pm

    You have a typo

    RegistraionNo instead of RegistrationNo

    in

    string SelectStatement = "SELECT * FROM MyTable where RegistrationNo = '@RegistraionNo'";
    

    another in

    textBox3.Text = reader["RegistratioNo"].ToString();
    

    You’ll copy 100 lines of

    I want a registration, I want a registration, I want a registration.

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

Sidebar

Related Questions

I'm building a WinForms application Window (form), inside that I'm using a FlowLayoutPanel, with
Am building window form application using VS2010.On my login form i collect useid and
Am building windows form application for a Hospital using VS2010 ON ACCESS 2010. I
Part of the GUI I'm building using tkinter has a pop-up window that says
I am building a Windows form application using .NET 3.5. I would like to
I 'am building a small windows form application. I have a View - a
I'm working with a new application at work that we're building out using Knockout.js
I am building this C# windows application. On a certain Form, I am using
I'm building a Windows Form that includes a combo box control, and I wanted
I am building a C# windows form app that pings multiple computers by name,

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.