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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:09:53+00:00 2026-05-21T09:09:53+00:00

hi i need to get the customer name from the user as in combo

  • 0

hi i need to get the customer name from the user as in combo box when the user selets the user i want that selected customer name should be searched in the sql table (here table name is “obbalance “)and all the entries in the table having the name as the selected customer naem it should be shown in the data grid view

cmd.Parameters.Add(New SqlParameter("@p1", SqlDbType.NVarChar).Value = ComboBox1.SelectedItem.ToString)

cmd = New SqlCommand("select obbalance from balance where custname=@p1", con)

dr = cmd.ExecuteReader()
Form2.Show()

after thios also it shows a error plz can u help me out if the code is wrong den help me to
do correct it i am new to vb.net plz ……….
it shows error in declaration so can u send me any other code or if this code den plz send the correct code plz

  • 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-21T09:09:54+00:00Added an answer on May 21, 2026 at 9:09 am
     cmd.Parameters.Add(New SqlParameter("@p1", SqlDbType.NVarChar).Value = ComboBox1.SelectedItem.ToString)
    
    cmd = New SqlCommand("select obbalance from balance where custname=@p1", con)
    
    dr = cmd.ExecuteReader()
    

    Instead of doing this you can do this also

    cmd=New SqlCommand("select columnname from tablename where custname='"& ComboBox1.SelectedItem.ToString &"'",con)
     dr = cmd.ExecuteReader()
    

    Why do you want parameterized query

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

Sidebar

Related Questions

I need to get the contents from this URL http://google.fr/ok in a NSString can
I need to read parameters from Context.Request that is written in a format like:
I have 2 tables, and want to get records from 1 table and to
I need to restrict the number of customer bo's returned from the database as
i need to group results by a field that requires a few joins from
I'm stuck one query here. I need see that which products customer X hasn't
Currently i have a customer class that the user can partially create, and finish
Let's say we get the following data from a CSV file: account_number balance customer
If I have a Customer class that just has simple properties (e.g. Name ,
I need get the id of an images which is place inside a datatemplate..

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.