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

  • Home
  • SEARCH
  • 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 3230206
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:53:59+00:00 2026-05-17T16:53:59+00:00

I want to dispaly column in datagrid view using custom query statement but i

  • 0
 
I want to dispaly column in datagrid view using custom query statement
but i want to send value to parametrized data in query 
how can i do this ?
my code is below  


select
c.customer_id,
c.customer_first_name,
c.customer_last_name,
c.customer_address,
c.account_number,
c.account_type,
a.account_balance,
t.transfer_amount_balance,
t.samebank_transfer_id,
t.account_number_same_bank,
t.transferdatetime
FROM customer_details c join account_details a on c.account_number = a.account_number
join transactions_details t on a.account_number = t.account_number where
c.customer_id = 'cus0010' and a.account_number = 'acc0010'

this above code working properly in sql server 2005

but the code below which is modified as per asp.net page for grid view is not showing
any result
select 
c.customer_id,
c.customer_first_name,
c.customer_last_name,
c.customer_address,
c.account_number,
c.account_type,
a.account_balance,
t.transfer_amount_balance,
t.samebank_transfer_id,
t.account_number_same_bank,
 t.transferdatetime
FROM customer_details c join account_details a on c.account_number = a.account_number 
join transactions_details t on a.account_number = t.account_number where
c.customer_id = 'Label1.Text' and a.account_number = 'Label2.Text'

 the above is placed in my custom sql query section it
 is triggered by button click in my asp page or any other
 idea to display it will be welcomed 
  • 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-17T16:53:59+00:00Added an answer on May 17, 2026 at 4:53 pm

    Use:
    string.Format("c.customer_id = '{0}' and a.account_number = '{1}'", Label1.Text, Label2.Text);

    Consider this query:
    string query = "insert into TestTable (Column1, Column2) values (@p1, @p2)";

    p1 & p2 are parameters, in order to set the value for the parameters you need to use:

    queryParameters[0] = new SqlCeParameter("p1", SqlDbType.NVarChar);
    queryParameters[0].Value = Label1.Text;
    queryParameters[1] = new SqlCeParameter("p2", SqlDbType.NVarChar);
    queryParameters[1].Value = Label2.Text;
    SqlCeCommand command = new SqlCeCommand(query);
    command.Parameters.AddRange(queryParameters);
    

    When the wizard is generating the query you need to use place holders/parameters for customer_ID and account_number and set their values by using parameters.

    Edit:
    In order to make the wizard create a parameter to use in the query, add a ? in the filter column in the query builder wizard.

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

Sidebar

Related Questions

I want to display JQGrid with all column headers but without any data rows
Using .net 2.0 . I want to display a column in a DataGridView as
I am using data grid view in Windows Form standalone application to display items
How can I programmatically perform click on a certain dataGridView column header? I want
i want to display two columns in datagrid view . first by sql-table second
I want to display the column 'name' after being found from the table mytest.
I want to display two column of my database into two JComboBox String rq1
I want to display sum of a column in a textbox when I hit
i want to display a list in more columns with 5 items/column my code
I want to display a UITableView with Multiple Columns. The first column will have

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.