473,324 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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 1304

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

Similar topics

2
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.