472,961 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Default values in Reference.cs

I want to be able to set some default values in my web application
....like..setting all strings to "" and all integers to int.MinValue....etc...

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.
Nov 23 '05 #1
4 4460
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...
Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #2
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...
Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #3
There is no Init medthod in the Reference.cs file...the Reference.cs is for
the Reference.map file under the Web Refernces folder in Soluction
Explorer...it is for mapping web application objects based on webservice
classes...I could create a GetNewOjbect webservice method...in which I could
send back a populated object with default values...but I want to try and make
as few calls to the webservice as possible and let the application do most of
the work.

Thanks for the reply though.
John Scott.

"ja*****@texeme.com" wrote:
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...


Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #4
There is no Init medthod in the Reference.cs file...the Reference.cs is for
the Reference.map file under the Web Refernces folder in Soluction
Explorer...it is for mapping web application objects based on webservice
classes...I could create a GetNewOjbect webservice method...in which I could
send back a populated object with default values...but I want to try and make
as few calls to the webservice as possible and let the application do most of
the work.

Thanks for the reply though.
John Scott.

"ja*****@texeme.com" wrote:
John Scott wrote:
I want to be able to set some default values in my web application
...like..setting all strings to "" and all integers to int.MinValue....etc...


Cant you do that in the Init method?

I have a web application object that is based on a web service class. When
I create this new object in the application

MyClass cls = new MyClass();

it creates the object without any problems, but all of the objects
attributes are null....I found that I can acutally set the web application
objects default values by just opening up my Reference.cs file and put in
those default values, but as soon as I make any changes to my web service and
update the references...all of those default values get blown away...is there
any way that visual studio will allow you to set default values for your web
service references??
Thanks in advance!!

John Scott.


Nov 23 '05 #5

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

Similar topics

10
by: sam | last post by:
Hi, I m wondering why I can't declare reference variable for default value in a function argument variable? eg. class A { void f(string &str="");
4
by: robert | last post by:
before i go flapping my gums and get deeper in alligators, wondering whether the following makes sense. i have a database which provides picklists for input. it started out with a 2 column key...
29
by: John Wood | last post by:
Even though CSC does its best to detect use of unassigned variables, it often misses it... for example if you just declare a double in a class without assigning a default value, it has a default...
5
by: Matt D | last post by:
I have a bunch of constants used in my web services that the client also needs to have. Is there a way to declare public properties that are part of a class or structure as constants or at least...
0
by: John Scott | last post by:
I want to be able to set some default values in my web application ....like..setting all strings to "" and all integers to int.MinValue....etc... I have a web application object that is based on...
10
by: Joel | last post by:
Is it true that if we don't specify a default constructor for our class, then the C# compiler provides us with its own that zeroes (or assigns default values) to the data members? I wrote a...
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
10
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, I'm trying to use the new VB 2008 right now and I want to know how to preset the company name and copyright informtion in Assembly Information. In my current VB 2005, company name...
43
by: kenneth | last post by:
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.