By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,238 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,238 IT Pros & Developers. It's quick & easy.

Form Problem

P: n/a
BD
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.

Jan 3 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Are you using data binding? Are you using version 2003 or 2005?

Robin S.
-----------------
"BD" <bw******@charter.netwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.

Jan 4 '07 #2

P: n/a
BD napisał(a):
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.
Is the CustomerID and LocationID integers or strings ?. You can't
display integers directly in textbox, so it may be the reason.

best,
Slawomir
Jan 4 '07 #3

P: n/a
BD

Sławek wrote:
BD napisał(a):
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.

Is the CustomerID and LocationID integers or strings ?. You can't
display integers directly in textbox, so it may be the reason.

best,
Slawomir
The CustomerID and LocationID are autonumber integers from a SQL
backend.

Jan 4 '07 #4

P: n/a
BD

RobinS wrote:
Are you using data binding? Are you using version 2003 or 2005?

Robin S.
-----------------
"BD" <bw******@charter.netwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.
I am using a remote server running MS SQL 2005 and visual studio pro
2005 for front end development. Yes, I am data-binding to the source.
However, my dataset nesting is not listing the subforms datatables in
the manner I am using them on this form. I think I will need to
develope a custom control to display this information but am unsure.

Jan 4 '07 #5

P: n/a

"BD" <bw******@charter.netwrote in message
news:11**********************@i80g2000cwc.googlegr oups.com...
>
RobinS wrote:
>Are you using data binding? Are you using version 2003 or 2005?

Robin S.
-----------------
"BD" <bw******@charter.netwrote in message
news:11**********************@v33g2000cwv.googleg roups.com...
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc
related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc
related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid
views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.

I am using a remote server running MS SQL 2005 and visual studio pro
2005 for front end development. Yes, I am data-binding to the source.
However, my dataset nesting is not listing the subforms datatables in
the manner I am using them on this form. I think I will need to
develope a custom control to display this information but am unsure.

Can you set up one dataset with all of the tables in it?
Because if you can do that, this should be a snap.

Let's say you can, and let's say you have \data_relations assigned
accordingly, you can bind the childgrids to the parent and
when the parent changes, the childgrids will show the children
that go with that parent.

Here's what you need:

A BindingSource for parent and each of the children.
I'm assuming parent = WorkOrderBindingSource,
children = WorkOrder_childBindingSource, like
WorkOrder_CustomerBindingSource.

Populate the dataset with all the tables. I'm assuming the
constraints are there; if they aren't, you can add them
to the dataset.

myDataSet.Relations.Add("WorkOrder_Customers",
myDataSet.Tables("WorkOrder").Columns("WorkOrderID "),
myDataSet.Tables("Customers").Columns("WorkOrderID "));

(do for all children)

Set up the databindings:

//parent
WorkOrderBindingSource.DataSource = myDataSet;
WorkOrderBindingSource.DataMember = "WorkOrder"; //name of table
WorkOrderIDTextBox.DataBindings.Add("Text", WorkOrderBindingSource,
"WorkOrderID"); //bind a text box; use the bindingsource
(etc)

//children

//set the binding source to the same one as the parent
WorkOrder_CustomerBindingSource.DataSource = WorkOrderBindingSource;

//set the datamember to the fk joining the tables
WorkOrder_CustomerBindingSource.DataMember = "FK_Customers_WorkOrder";

//set the data source on the child view to its own binding source
CustomerDataGridView.DataSource = WorkOrder_CustomersBindingSource ;

(do same for all children)

Run it.

I'm not a C# programmer, so if I missed any semi-colons or got any
brackets wrong, my apologies.

Robin S.
Jan 5 '07 #6

P: n/a

"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Oo******************************@comcast.com. ..
>
"BD" <bw******@charter.netwrote in message
news:11**********************@i80g2000cwc.googlegr oups.com...
>>
RobinS wrote:
>>Are you using data binding? Are you using version 2003 or 2005?

Robin S.
-----------------
"BD" <bw******@charter.netwrote in message
news:11**********************@v33g2000cwv.google groups.com...
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc
related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc
related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid
views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.

I am using a remote server running MS SQL 2005 and visual studio pro
2005 for front end development. Yes, I am data-binding to the
source.
However, my dataset nesting is not listing the subforms datatables in
the manner I am using them on this form. I think I will need to
develope a custom control to display this information but am unsure.


Can you set up one dataset with all of the tables in it?
Because if you can do that, this should be a snap.

Let's say you can, and let's say you have \data_relations assigned
accordingly, you can bind the childgrids to the parent and
when the parent changes, the childgrids will show the children
that go with that parent.

Here's what you need:

A BindingSource for parent and each of the children.
I'm assuming parent = WorkOrderBindingSource,
children = WorkOrder_childBindingSource, like
WorkOrder_CustomerBindingSource.

Populate the dataset with all the tables. I'm assuming the
constraints are there; if they aren't, you can add them
to the dataset.

myDataSet.Relations.Add("WorkOrder_Customers",
myDataSet.Tables("WorkOrder").Columns("WorkOrderID "),
myDataSet.Tables("Customers").Columns("WorkOrderID "));

(do for all children)

Set up the databindings:

//parent
WorkOrderBindingSource.DataSource = myDataSet;
WorkOrderBindingSource.DataMember = "WorkOrder"; //name of table
WorkOrderIDTextBox.DataBindings.Add("Text", WorkOrderBindingSource,
"WorkOrderID"); //bind a text box; use the bindingsource
(etc)

//children

//set the binding source to the same one as the parent
WorkOrder_CustomerBindingSource.DataSource = WorkOrderBindingSource;

//set the datamember to the fk joining the tables
WorkOrder_CustomerBindingSource.DataMember = "FK_Customers_WorkOrder";

//set the data source on the child view to its own binding source
CustomerDataGridView.DataSource = WorkOrder_CustomersBindingSource ;

(do same for all children)

Run it.

I'm not a C# programmer, so if I missed any semi-colons or got any
brackets wrong, my apologies.

Robin S.
One other thing -- if you have something other than a grid for
the children, you can bind those to their binding source.

CustomerNameTextBox.DataBindings.Add("Text",
WorkOrder_CustomerBindingSource, "CustomerName");

It's like magic!

Robin S.

Jan 5 '07 #7

P: n/a
BD

RobinS wrote:
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Oo******************************@comcast.com. ..

"BD" <bw******@charter.netwrote in message
news:11**********************@i80g2000cwc.googlegr oups.com...
>
RobinS wrote:
Are you using data binding? Are you using version 2003 or 2005?

Robin S.
-----------------
"BD" <bw******@charter.netwrote in message
news:11**********************@v33g2000cwv.googleg roups.com...
Moving from MS Access to .Net using C# languag. Problem trying to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc
related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc
related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid
views.
Problem is have been unable to present 'Customer' and 'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.
I am using a remote server running MS SQL 2005 and visual studio pro
2005 for front end development. Yes, I am data-binding to the
source.
However, my dataset nesting is not listing the subforms datatables in
the manner I am using them on this form. I think I will need to
develope a custom control to display this information but am unsure.

Can you set up one dataset with all of the tables in it?
Because if you can do that, this should be a snap.

Let's say you can, and let's say you have \data_relations assigned
accordingly, you can bind the childgrids to the parent and
when the parent changes, the childgrids will show the children
that go with that parent.

Here's what you need:

A BindingSource for parent and each of the children.
I'm assuming parent = WorkOrderBindingSource,
children = WorkOrder_childBindingSource, like
WorkOrder_CustomerBindingSource.

Populate the dataset with all the tables. I'm assuming the
constraints are there; if they aren't, you can add them
to the dataset.

myDataSet.Relations.Add("WorkOrder_Customers",
myDataSet.Tables("WorkOrder").Columns("WorkOrderID "),
myDataSet.Tables("Customers").Columns("WorkOrderID "));

(do for all children)

Set up the databindings:

//parent
WorkOrderBindingSource.DataSource = myDataSet;
WorkOrderBindingSource.DataMember = "WorkOrder"; //name of table
WorkOrderIDTextBox.DataBindings.Add("Text", WorkOrderBindingSource,
"WorkOrderID"); //bind a text box; use the bindingsource
(etc)

//children

//set the binding source to the same one as the parent
WorkOrder_CustomerBindingSource.DataSource = WorkOrderBindingSource;

//set the datamember to the fk joining the tables
WorkOrder_CustomerBindingSource.DataMember = "FK_Customers_WorkOrder";

//set the data source on the child view to its own binding source
CustomerDataGridView.DataSource = WorkOrder_CustomersBindingSource ;

(do same for all children)

Run it.

I'm not a C# programmer, so if I missed any semi-colons or got any
brackets wrong, my apologies.

Robin S.

One other thing -- if you have something other than a grid for
the children, you can bind those to their binding source.

CustomerNameTextBox.DataBindings.Add("Text",
WorkOrder_CustomerBindingSource, "CustomerName");

It's like magic!

Robin S.
You are correct, once I nested tables into the same dataset, everything
worked the way I wanted. Thank you very much for your help.

BD

Jan 8 '07 #8

P: n/a

"BD" <bw******@charter.netwrote in message
news:11**********************@s80g2000cwa.googlegr oups.com...
>
RobinS wrote:
>"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Oo******************************@comcast.com ...
>
"BD" <bw******@charter.netwrote in message
news:11**********************@i80g2000cwc.googlegr oups.com...

RobinS wrote:
Are you using data binding? Are you using version 2003 or 2005?

Robin S.
-----------------
"BD" <bw******@charter.netwrote in message
news:11**********************@v33g2000cwv.google groups.com...
Moving from MS Access to .Net using C# languag. Problem trying
to
duplicate form with structure as follows:
1. Main form 'Work Order' displayed as textboxes
2. subform 'Customers' textboxes showing name, address, etc
related
by 'CustomerID'
3. subform 'Locations' textboxes showing name, address, etc
related
by 'LocationID'
4. subform 'Material' on tabbed interface datasheet related
by
'WorkOrderID'
5. subform 'Labor' on tabbed interface datasheet related by
'WorkOrderID'

Have successfully created child form "Work Order" with
textboxes,
tabbed interface for 'Material' and 'Labor' records in datagrid
views.
Problem is have been unable to present 'Customer' and
'Location'
information in textboxes on the form related tables.

Again, thank you in advance for any help.
I am using a remote server running MS SQL 2005 and visual studio
pro
2005 for front end development. Yes, I am data-binding to the
source.
However, my dataset nesting is not listing the subforms datatables
in
the manner I am using them on this form. I think I will need to
develope a custom control to display this information but am
unsure.

Can you set up one dataset with all of the tables in it?
Because if you can do that, this should be a snap.

Let's say you can, and let's say you have \data_relations assigned
accordingly, you can bind the childgrids to the parent and
when the parent changes, the childgrids will show the children
that go with that parent.

Here's what you need:

A BindingSource for parent and each of the children.
I'm assuming parent = WorkOrderBindingSource,
children = WorkOrder_childBindingSource, like
WorkOrder_CustomerBindingSource.

Populate the dataset with all the tables. I'm assuming the
constraints are there; if they aren't, you can add them
to the dataset.

myDataSet.Relations.Add("WorkOrder_Customers",
myDataSet.Tables("WorkOrder").Columns("WorkOrderID "),
myDataSet.Tables("Customers").Columns("WorkOrderID "));

(do for all children)

Set up the databindings:

//parent
WorkOrderBindingSource.DataSource = myDataSet;
WorkOrderBindingSource.DataMember = "WorkOrder"; //name of table
WorkOrderIDTextBox.DataBindings.Add("Text", WorkOrderBindingSource,
"WorkOrderID"); //bind a text box; use the bindingsource
(etc)

//children

//set the binding source to the same one as the parent
WorkOrder_CustomerBindingSource.DataSource =
WorkOrderBindingSource;

//set the datamember to the fk joining the tables
WorkOrder_CustomerBindingSource.DataMember =
"FK_Customers_WorkOrder";

//set the data source on the child view to its own binding source
CustomerDataGridView.DataSource = WorkOrder_CustomersBindingSource
;

(do same for all children)

Run it.

I'm not a C# programmer, so if I missed any semi-colons or got any
brackets wrong, my apologies.

Robin S.

One other thing -- if you have something other than a grid for
the children, you can bind those to their binding source.

CustomerNameTextBox.DataBindings.Add("Text",
WorkOrder_CustomerBindingSource, "CustomerName");

It's like magic!

Robin S.

You are correct, once I nested tables into the same dataset,
everything
worked the way I wanted. Thank you very much for your help.

BD
You're welcome; I'm glad it helped!

Robin S.
Jan 9 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.