473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Datagrid / Dataset question


Hi there,

I have a form with a Datagrid on it; Datagrid is bound to an untyped dataset.
When I fill the dataset (with an oleDBDataAdapter), the data is not diplayed directly in the grid;
I have to expand some control that appears in the datagrid, and then select the table name
before the data is shown. How can I make this work directly??

Thanks in advance!

Gr.
Phil
Nov 16 '05 #1
3 1275
Try binding right to the table, instead of the dataset.
-mike
MVP
"Phil Snijder" <hp********@yahoo.com> wrote in message
news:40***********************@dreader4.news.xs4al l.nl...

Hi there,

I have a form with a Datagrid on it; Datagrid is bound to an untyped
dataset.
When I fill the dataset (with an oleDBDataAdapter), the data is not
diplayed directly in the grid;
I have to expand some control that appears in the datagrid, and then
select the table name
before the data is shown. How can I make this work directly??

Thanks in advance!

Gr.
Phil


Nov 16 '05 #2
I have to expand some control that appears in the datagrid, and then
select the table name
before the data is shown. How can I make this work directly??


You should try :

dataGrid1.SetDataBinding(dataset, "table");

or.....

dataGrid1.DataSource = dataset;
dataGrid1.DataMember = "table";
Nov 16 '05 #3
I should add that, with at lest .NET Framework 1.0, the second approach
should never be used, while the first one is the way to go. The difference
is that the SetDataBinding method appears to perform some inner
initializations on the DataGrid, and these initializations never occur when
the DataSource and the DataMember properties are assigned directly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Rikki" <no@spam.no> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
I have to expand some control that appears in the datagrid, and then
select the table name
before the data is shown. How can I make this work directly??


You should try :

dataGrid1.SetDataBinding(dataset, "table");

or.....

dataGrid1.DataSource = dataset;
dataGrid1.DataMember = "table";


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: magister | last post by:
Hello, I have xml like this.... <test> <question>sdfsa</question> <section><question>43ga</question> <question>asdf</question> </test>
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: Scott | last post by:
Hi all. A few days ago i ask this question and got a good quick response. I tried out what they said and it worked. However I have now come to try the same thing in another program and it...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
12
by: Daniel Walzenbach | last post by:
Hi, I want to display a Label in a DataGrid according to some condition. I therefore check whether the condition is true in the ItemDateBound EventHandler of the DataGrid. Unfortunately the...
3
by: Just D | last post by:
Hi, If anybody needs to show some data retrieved from the database table, what method is more preferrable? 1. DataSet ds = ...; DataGrid.Data.Source.ds; DataGrid.Bind(); 2. Write a custom...
3
by: Danky | last post by:
Hello Masters! Anyone can help me with the datagrid, well, the app load a lot of data from DB and it show on the datagrid, and well, I need to allow paging and.... the issue is with the event...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
6
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi - I'm having trouble refreshing a datagrid control bound to a dataset that was created from the New Data Source wizard. What is the code required to refresh the datagrid with data from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.