473,320 Members | 1,950 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,320 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 4475
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: 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
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.