We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to query a datatable used by grid in C#?

Thread ID:

Created:

Updated:

Platform:

Replies:

26287 Mar 18,2005 09:56 AM Mar 18,2005 11:12 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 18, 2005 09:56 AM

Hi, I have a datatable used as datasource of my databoundgrid. I need to query this table in the codes periodially to get the most current information. It is kind of like select sum(quantity) from table group by company, region the quantity, region adn company are all columns for this table and names of the columns. It is a easy job in sql but I did not find the proper syntax in C#. Could anyone please provide some samples? Thanks Chris

Administrator [Syncfusion]
Replied On March 18, 2005 11:12 AM

Our GridDataBoundGrid displays whatever data is in the DataSource. So, if youwant to ''reload'' the data, then you need to reload whatever datasource you are using. This is completely independent fo our grid. It sounds like you want to should use a SqlDataAdapter/SqlConnection to load a sql query into a DataTable. Then you would set this DataTable as the DataSource for the grid, and it would show your sql query results. In the 3.0.1.0 grid User Guide, check the DataBoundGrid Tutorial. It steps you through using the desiger to create a dataadapter that uses a sql query.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;