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. Image for the cookie policy date

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

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

1 Reply

AD Administrator Syncfusion Team March 18, 2005 04:12 PM UTC

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 grid User Guide, check the DataBoundGrid Tutorial. It steps you through using the desiger to create a dataadapter that uses a sql query.

Live Chat Icon For mobile
Up arrow icon