473,401 Members | 2,146 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,401 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 4480
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.