[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I fill DataGrid with values on runtime

Posted on 2008-10-03
6
Medium Priority
?
314 Views
Last Modified: 2013-11-17
I am trying to compile a sample application that is a datagrid which is connected to a dataset (which is a table in database).

I've connected all the elements but failed to fill in data in the grid (from the table) --
How do I accomplish that?
0
Comment
Question by:amitbueno
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:the_bachelor
ID: 22634092
I think your question is rather vague as it does not tell which technique your're employing to "connect" your stuff.
A little code will be welcome here...
0
 

Author Comment

by:amitbueno
ID: 22634188
Hard so post a code,. because all I did was in design time.
In delphi connecting a datagrid to database done visually,. I thought that in vs vb as well... (though I probably was mistaken)

In design time, I created a wince application, put a datagrid on the fom. Created a database with a table...
Assigned DataSet,. And databinding, and created a datamember which is the table from the database,. in the dataset I specified the database, and datamember.

Now I would like to display a grid with the table data in it.
0
 
LVL 7

Expert Comment

by:the_bachelor
ID: 22634658
Sorry I for some odd reason thought you was using ASP.NET. Sounds like u're building a Windows app.
Question for you: Does the database itself has data in it?

Here is what i did, might help you. I'm using VS 2008.
So I dragged a DataGridview on my form, added a Project Datasource as prompted, Selected a table and Boom I got data bound the grid...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:amitbueno
ID: 22634831
I am using .NET Compact Framework.
It doesn't have the DataGridView only DataGrid... But I think it is the same as the datagridview.
I selected a database and a table in the DataSetBindingSource, and assigned the Grid to it.

If that is enough why don't I see the data when running the application?
The database is with data in it of course...
0
 
LVL 15

Accepted Solution

by:
JackOfPH earned 150 total points
ID: 22639043
Set the datasource of the datagrid in the form load event of the form.

For example put this code in the Form Load Event:

Datagrid1.Datasource = Dataset.Table("YourTable")
0
 

Author Comment

by:amitbueno
ID: 22640060
A little progress...

I've designed in design time, the datasource to point to the table,. Yet when running the code it raises an exception saying that the table doesn't exist (although I've designed a reference to it)
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question