473,468 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1276
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.