Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global Properties?
Message
From
18/04/2004 10:12:12
 
 
To
18/04/2004 08:59:39
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00895917
Message ID:
00895928
Views:
16
John,

Unless it's a typo, I think you probably have to make the struct itself static also, not just it's members.

~~Bonnie

>I changed my storage to a struct after I posted the question this morning. However, given the following code, any attemp to access the struct's members gives me an "out of scope" error when attempting to view in the watch window.
>
>
>
>
>using System;
>using AMS.Profile;
>
>
>namespace OrderPro
>{
>	/// <summary>
>	/// Summary description for AppStartUp.
>	/// </summary>
>	public class AppStartUp
>	{
>		public AppStartUp()
>		{
>			//
>			// TODO: Add constructor logic here
>			//
>		}
>
>		public struct AppDefaults
>		{
>			public static string server = "";
>			public static string dataBase = "";
>			
>			public static string adminPath = "";
>			public static string sqlConn = "";		
>		}
>
>		public static void SetAppDefaults()
>		{
>			Registry profile = new Registry();
>			AppDefaults.server = profile.GetValue("DBSettings","DBServer","");
>			AppDefaults.dataBase = profile.GetValue("DBSettings","DBName","");
>			
>			AppDefaults.adminPath = "c:\vsdevelop";
>			AppDefaults.sqlConn = "SERVER=" + AppDefaults.server.ToUpper().Trim() + ";UID=uid;PWD=pwd;DATABASE=database";
>		}
>		
>		public static void LoadProgramSettings()
>		{
>			SetAppDefaults();
>		}
>	}
>}
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform