Problems with a grid control

Csharp , .net , SqlServer2005 Havanna, Cuba
  • 11 years ago

    Good afternoon everyone:

    I am developing an application in C # with SQLServer2005. In one of the user controls that I use to display data from different queries in one gridcontrol. When I make the first query and update the datasourse loads fine but when I do the second one shows the number of columns for the first consultation.

    What can I do to fix this problem?

  • 11 years ago

    Good afternoon everyone:

    I am developing an application in C # with SQLServer2005. In one of the user controls that I use to display data from different queries in one gridcontrol. When I make the first query and update the datasourse loads fine but when I do the second one shows the number of columns for the first consultation.

    What can I do to fix this problem?

  • 11 years ago

    You should Collect All data in a Particular Data Table and upload it to a GridControl. May be These lines will help you.

    Dim dtTable As New DataTable

    ' code for collect all ur data to dtTable

    DataGridView1.Rows.Clear() DataGridView1.DataSource = Nothing DataGridView1.DataSource = dtTable

    Thanks.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”