473,592 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to position records in detail table???

here is the following situation :

I have a dataset with two tables

this.daCustomer s.Fill(dsData1, "Customers" );
this.daOrders.F ill(dsData1, "Orders");

as You see there are tables from Northwind :)
these tables have a relation
this.dsData1.Re lations.Add("Cu stOrd",
dsData1.Tables[0].Columns["Customerid "],
dsData1.Tables[1].Columns["Customerid "]);
this.dsData1.Re lations.Add("Or dDet",
dsData1.Tables[1].Columns["OrderId"], dsData1.Tables[2].Columns["OrderId"]);

and currencymanager

crmCustomers =
(CurrencyManage r)this.BindingC ontext[dsData1.Tables["Customers"]];

I bind these two tables to to datagrids
first one as master:

this.grdCustome rs.DataSource = dsData1.Tables[0];

sencond one as detial:

this.grdOrders. DataSource = dsData1.Tables[0];
this.grdOrders. DataMember= "CustOrd";

finally I add a label with current position of active record in the
master table.

this.lblCustome rs.Text=(crmCus tomers.Position +1).ToString() + "/" +
crmCustomers.Co unt.ToString();

until now everything is clear and it works. Now please tell me how to
create similiar label which allows me to show position of active record
in the detail table ???? It must be very easy but I have been thinking
on it second day and I still have no ideas :( All tutorials and
examples show how to use currency manager to master table but I didn't
find any peace of code with currency manager in detail table

The next question is how to sort, filter and search this detial table
but this question I'm going to ask when I solve problem with positioning

thanks in advance for any help
K.


Nov 16 '05 #1
1 1640
Hi,

Won't something like the following work:

crmOrders =
(CurrencyManage r)this.BindingC ontext[grdOrders.DataS ource,
grdOrders.DataM ember];

this.lblOrders. Text=(crmOrders .Position+1).To String() + "/" +
crmOrders.Count .ToString();

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"krzys" <kr*********@XX gazeta.pl> wrote in message
news:cs******** **@inews.gazeta .pl...
here is the following situation :

I have a dataset with two tables

this.daCustomer s.Fill(dsData1, "Customers" );
this.daOrders.F ill(dsData1, "Orders");

as You see there are tables from Northwind :)
these tables have a relation
this.dsData1.Re lations.Add("Cu stOrd",
dsData1.Tables[0].Columns["Customerid "],
dsData1.Tables[1].Columns["Customerid "]);
this.dsData1.Re lations.Add("Or dDet", dsData1.Tables[1].Columns["OrderId"],
dsData1.Tables[2].Columns["OrderId"]);

and currencymanager

crmCustomers =
(CurrencyManage r)this.BindingC ontext[dsData1.Tables["Customers"]];

I bind these two tables to to datagrids
first one as master:

this.grdCustome rs.DataSource = dsData1.Tables[0];

sencond one as detial:

this.grdOrders. DataSource = dsData1.Tables[0];
this.grdOrders. DataMember= "CustOrd";

finally I add a label with current position of active record in the master
table.

this.lblCustome rs.Text=(crmCus tomers.Position +1).ToString() + "/" +
crmCustomers.Co unt.ToString();

until now everything is clear and it works. Now please tell me how to
create similiar label which allows me to show position of active record in
the detail table ???? It must be very easy but I have been thinking on it
second day and I still have no ideas :( All tutorials and examples show
how to use currency manager to master table but I didn't find any peace of
code with currency manager in detail table

The next question is how to sort, filter and search this detial table but
this question I'm going to ask when I solve problem with positioning

thanks in advance for any help
K.


Nov 16 '05 #2

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

Similar topics

1
3526
by: Dave | last post by:
I am building an invoicing database. I have no problems searching for due dates and generating the invoice header. The problem is generating the invoice detail. My customers may have more than one item that needs to go into the invoice detail table. For example: customer #123 has 2 items that need to be placed into the detail table.
11
14859
by: Jeremy Pridmore | last post by:
Hi All, Here's a challenge. If there is a 'one word' answer to this, i.e. the name of a built in SQL Server function I can use, that would be great! However... I have a standard 1:m relationship, e.g. tblHeader and tblDetail. I want to create a view of records from 'tblHeader' and within that
1
4323
by: Rowan | last post by:
Hi there, it has been a while since i have posted. I am in a situation where I am stumped. I am learning to build a dts package where I am connecting to a table in an AS400. This database is being maintained by an outsourced company and therefore I can't change the table structure or even ask them to. Anyway, this table currently has about 104,000 records. I am building a package to check it and pull out the most recent records and...
3
6107
by: mark | last post by:
How do I get all fields on one page of a report? I have a report that has a column for each day of the week and 6 records for each day. I need each weekday's records returned on only one detail page. Instead I am getting a new table layout for each day of the week. I have tried grouping on every record and combination I can, manipulating the Group Properties but can't get it right. I have the entire report in the Detail Section, with...
3
1759
by: William Wisnieski | last post by:
Hello Everyone, I'm helping out a non-profit school with their database. They would like to know the last gift made by each donor, the donor name, and the gift amount. I built a query based on two tables. The donor name is from the first table . The gift and are in the second table . The query works except for one problem. It will return the proper number of records with the most recent gift date as long as I don't add the
1
1952
by: Rick A | last post by:
The database I'm developing for a local charity has a table with detail records of individual transactions with our donors. This table has an integer "donorID" column that is a foreign key to a "donor" table containing names, addresses, etc. The data entry people use a custom form to enter new transactions into the detail table. Occasionally incorrect data gets entered, so I also want to provide the data entry folks with a convenient...
7
2001
by: Ron | last post by:
Hi All, Using Access2000, winXP. Table 1 = tblClients displayed on frmClients via qryClients. 2nd table = tblInvoices shown on frmInvoices via qryInvoices. 2nd table = tblDetails shown on subform(to frmInvoices) sfrmDetails via qryDetails. Relationship built between tblClients/tblInvoices/tblDetails by ClientID. Relationship between tblInvoices/tblDetails by InvoiceID. All works fine if
2
2589
by: rdraider | last post by:
Using SQL 2000, how can you combine multiple records into 1? The source data is varchar(255), the destination will be text. I need help with the select statement. example tables: CREATE TABLE ( , , (255), ,
1
2608
by: Miley | last post by:
Hi everyone, This is my question/problem. I have a table with orders and a table with order details. Clients can order multiple products at once during one order, so one line has to be inserted in the main order table, and multiple order details from the same order in the order detail table. How do I do this? Right now if a client orders 5 products during one order, the order detail table looks fine, but also get 5 records in my main...
0
7935
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8236
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
6642
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3851
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2379
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 we have to send another system
0
1202
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.