Missing partial modifier on declaration of type 'DataSet1'
-
This little issue is really freaking me. I have this vanilla web service that returns a typeed DataSet (DataSet1). The web service works fine in IE and also with a test application. But when I try to use WebService Studio to test the web service, it gives me the following error: c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(523,14) : error CS0260: Missing partial modifier on declaration of type 'DataSet1'; another partial declaration of this type exists c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(664,26) : error CS0102: The type 'DataSet1' already contains a definition for 'DataTable1RowChangeEventHandler' c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(668,18) : error CS0260: Missing partial modifier on declaration of type 'DataSet1.DataTable1DataTable'; another partial declaration of this type exists Does any one has any clue whats wrong with web service studio. NOTE: I am using .NET 2.0 / VS 2005 Atul
-
This little issue is really freaking me. I have this vanilla web service that returns a typeed DataSet (DataSet1). The web service works fine in IE and also with a test application. But when I try to use WebService Studio to test the web service, it gives me the following error: c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(523,14) : error CS0260: Missing partial modifier on declaration of type 'DataSet1'; another partial declaration of this type exists c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(664,26) : error CS0102: The type 'DataSet1' already contains a definition for 'DataTable1RowChangeEventHandler' c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(668,18) : error CS0260: Missing partial modifier on declaration of type 'DataSet1.DataTable1DataTable'; another partial declaration of this type exists Does any one has any clue whats wrong with web service studio. NOTE: I am using .NET 2.0 / VS 2005 Atul
Partial classes allow you do devide classes into multiple files... for example file1.cs contains
namespace one.two.three { partial class four() // note the partial modifier { public const string a = "a"; } }
and file2.cs containsnamespace one.two.three { partial class four() // note the partial modifier { public const string b = "b"; } }
The compiler would think the same of those two files, as if it was a single code file containingnamespace one.two.three { class four() // partial modifier is missing in this line { public const string a = "a"; public const string b = "b"; } }
(not the partial modifier is missing in the class declaration) Now when you use this feature (which is very usefull and handy by the way) you MUST use the 'partial' modifier in each code file containing the same class... In other words, if either the class declaration in my example above (code file file1.cs and file2.cs) misses the partial modifier, your compiler doesn't understand what you want and gives that message.
I love it when a plan comes together http://www.zonderpunt.nl[^]