473,480 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

selecting DataSource of a DataGrid when the dataset is in a different form?

Hi, I'm writing a program with Microsoft Visual C# .net version 2002
the program has 4 Forms
and all the database components (DataSet, OleDbDataAdapter, OleDbConnection)
are in form4
as I've got DataGrids in the other forms,
if I go in one of these forms
in the datagrid property, selecting the DataSource I can't select the
dataset in form4
how can I see the dataset in form4 from the other forms?
thankyou
Sam
Nov 15 '05 #1
2 1328

"Sam74" <sa***@libero.it> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
Hi, I'm writing a program with Microsoft Visual C# .net version 2002
the program has 4 Forms
and all the database components (DataSet, OleDbDataAdapter, OleDbConnection) are in form4
as I've got DataGrids in the other forms,
if I go in one of these forms
in the datagrid property, selecting the DataSource I can't select the
dataset in form4
how can I see the dataset in form4 from the other forms?
thankyou
Sam

DataSets are global (project namespace, not members of a form), aren't they?
Nov 15 '05 #2
You may want to create a Class that holds that dataset as a Property and at
runtime bind it accordingly. If you use it as a Static property, you should
be ok.

Cheers,

Bill
"Sam74" <sa***@libero.it> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
Hi, I'm writing a program with Microsoft Visual C# .net version 2002
the program has 4 Forms
and all the database components (DataSet, OleDbDataAdapter, OleDbConnection) are in form4
as I've got DataGrids in the other forms,
if I go in one of these forms
in the datagrid property, selecting the DataSource I can't select the
dataset in form4
how can I see the dataset in form4 from the other forms?
thankyou
Sam

Nov 15 '05 #3

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

Similar topics

6
13557
by: aaa | last post by:
Hi I am trying to create a read-only DataGrid that would always have current row selected. Currently, I am using method: public void SelectDataGridRow(DataGrid dg) { if (dg.CurrentRowIndex >...
1
3879
by: freddy | last post by:
I have a class for DatabaseManager.cs that has all the connection path, add, update, delete.I have a problem with the datagrid because I have a form that contains the datagrid called...
0
1253
by: Johann Blake | last post by:
I have a form with textboxes that are bound to a dataset. The dataset contains two tables and some of the textboxes use data from one table while other textboxes use data from the other table. I...
6
2043
by: aaj | last post by:
Hi all I use a data adapter to read numerous tables in to a dataset. The dataset holds tables which in turn holds full details of the records i.e. keys, extra colums etc.. In some cases I...
6
1939
by: vips | last post by:
Page_Load datagrid1.datasource=dataset1 //I am filling the datagrid and it works fine when page is displayed end ---------------
1
3317
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been...
2
2650
by: AA | last post by:
Do anyone know how to refresh the datagrid without setting datasource to nothing and initialize the grid again? My case is that I have form consisting from two part. The upper part is a datagrid...
11
3423
by: Ron L | last post by:
I have a data table that lists a series of items in my database. In my user form, I want the user to be able to filter by a number of criteria (e.g. location, contract, date modified, etc). Other...
0
1351
by: JoaquimC | last post by:
Hello, I'm new to c#, and i am trying to implement the following behaviour to a DataGrid: When i locate a record in one DataTable i want to select and show the respective grid row in the...
0
6920
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...
0
7059
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
7010
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...
1
4799
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
4499
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
3003
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
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 ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.