473,513 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused about app structure

lc

Actually, I have things working but am not clear why do they work.
Here's the setup:

3 projects
1. Data component (DataAuth) with connection, adapter and typed
dataset (DSAuthors). Two methods,
public DSAuthors OpenAuthors( )
public DSAuthors SaveAuthors( DSAuthors dsDelta )

2. Web service (WSAuthors) with two methods as well:
public DataAuth.DSAuthors GetAuthors()
public DataAuth.DSAuthors SaveAuthors( DataAuth.DSAuthors auth )

3. WinForms app (WinAuth) with two methods:
private void LoadAuthors() -> works as expected
{
WinAuth.refWSAuthors.svcAuth ws
= new WinAuth.refWSAuthors.svcAuth();
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
WinAuth.DSAuthors1.Merge( ws.GetAuthors() );
}

and
private void SaveAuthors()
{
WinAuth.refWSAuthors.svcAuth ws;
// DMAuthors.DSAuthors authChanges;
WinAuth.refWSAuthors.DSAuthors authChanges;

ws = new WinAuth.refWSAuthors.svcAuth();
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;

authChanges = new WinAuth.refWSAuthors.DSAuthors();

authChanges.Merge( dsAuthors1.GetChanges() );
authChanges = ws.SaveAuthors( authChanges );
dsAuthors1.Merge( authChanges );
dsAuthors1.AcceptChanges();
}

Here's where I got confused: I would expect that a call to
ws.SaveAuthors, which is defined as "accept and return
DataAuth.DSAuthors" would indeed need a var of that type. However,
compiler wouldn't let anything through unless it's a type of
WinAuth.refWSAuthors1.DSAuthors. So instead of

DMAuthors.DSAuthors authChanges;
...
authChanges = ws.SaveAuthors( authChanges );

I had to use

WinAuth.refWSAuthors.DSAuthors authChanges;
...
authChanges = ws.SaveAuthors( authChanges );

The funniest thing of all is that everything works. I'm very much
newbie in .NET world and this is very confusing to me. Any help would
be highly appreciated.

TIA

lc
Jul 21 '05 #1
0 1314

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

Similar topics

2
1683
by: Kevin C. | last post by:
Can someone explain why the file output produces all zeros? It seems to work fine in memory (e.g. passing char pointers to printf) but when I output the file, it comes out as zeros. Bookkeeping...
2
2970
by: Robert W. | last post by:
I'm trying to write a utility that will use Reflection to examine any data model I pass it and correctly map out this model into a tree structure. When I say "any" , in fact there will only be 3...
0
301
by: lc | last post by:
Actually, I have things working but am not clear why do they work. Here's the setup: 3 projects 1. Data component (DataAuth) with connection, adapter and typed dataset (DSAuthors). Two methods,...
20
1790
by: mechanicfem | last post by:
I thought (as they're in c99) that flexible arrays were there for a number of reasons - but I also thought they'd be great for stepping into structures (say) that were aligned in memory after (say)...
26
4654
by: Dodger | last post by:
Okay, background... yes, I am another of those evil, spurned, damnable Perl mongers, but I'm not trying to start a flamewar, I'm juust tryung to understand something... I can write a script in...
7
3033
by: fairyvoice | last post by:
i am writing a very simple c/s socket program, i just wanted the client to first write to the server, after server get the message it, write to the client, the the client write again. here's the...
7
2055
by: Leszek L. | last post by:
Hello, I am new to this group; if my question is OT then please excuse me and tell me where to go. I am using MS Visual C++ with some of its graphics libraries. Now the compiler tells me that...
9
2673
by: Lalatendu Das | last post by:
I have seen a header file in which one structure is defined with extern declaration in a header file and declared one variable of that structure in one C-file. The code goes as mentioned below . I...
4
2001
by: mattmao | last post by:
I am moving onto the tough part in learning C:( First, about the declaration of a user defined structure: I found this syntax in my lecture notes: struct userinfo { char username; ...
0
7162
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
7384
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
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
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
5686
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
3234
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
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1597
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 ...
0
456
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.