[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

VB.Net 4 Datagridview Not Showing All Data

I have a datagridview that I'm binding the source to dynamically at runtime.  When I run the program the datagridview only displays one columns data.  All others are blank.  I've checked the datapropertynames and they are all correct and all of the data is correct and there coming from the database.  The only difference that I can think of is tha the one column that is displaying data is text and the others are numbers.  I wouldn't think that would make a difference, but you never know.  Does anyone have any suggestions?

Thanks for any and all help.
0
rcblevins
Asked:
rcblevins
  • 4
  • 2
1 Solution
 
nepaluzCommented:
show us some code of how you:

1. Get the data from the database
2. Bind the data to the grid

0
 
rcblevinsAuthor Commented:
This is the code I'm using is below.  I simply pass the sql command name and the data grid to this code and it fills the data grid.  Other parts of the program are working correctly using this same code.  Is something configured wrong on the datagrid.  I've went over it several times and everything seems to be configured correctly.  Thanks for your help.
 
Dim db As New DBHelpers
        Dim tb As New DataTable

        Dim dataGridViewDR As SqlDataReader = db.ExecuteProcedureReturnSqlDR(commandName, Parameters)

        CEIDataGridView.AutoGenerateColumns = False

        tb.Load(dataGridViewDR)

        CEIDataGridView.DataSource = tb

        dataGridViewDR.Close()

        dataGridViewDR.Dispose()
0
 
nepaluzCommented:
what is dataGridViewDR in tb.Load(dataGridViewDR)?
Also, try
CEIDataGridView.AutoGenerateColumns = True

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
rcblevinsAuthor Commented:
dataGridViewDR is the datareader that i"m using to get the data from sql server to load into the data grid.  Sorry I should have specified that I am manually creating the columns in the datagridviews, which is why autogeneratecolumns is set to false.  Is there anything that may not be configured properly on the datagridview that may be causing this problem.  All the columns have the correct datapropertynames and one column is displaying data.  Thanks for your help.
0
 
rcblevinsAuthor Commented:
Sorry, I've found the problem.  I was loading the same data grid 3 difference times with different data, which explains why the data wasn't present in some of the columns.  Thanks for everyones help.
0
 
rcblevinsAuthor Commented:
Found I had programmed something wrong.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now