Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

Exception trying to retrieve from My.Resources

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry Gilbert - 13 Feb 2007 16:44 GMT
In a Property Set statement, I'm trying to retrieve a value from My.Resources
like this:

   Public Property TimeEnd() As DateTime
       
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
       Get
           Return _timeEnd.Date
       End Get
       
<System.Runtime.CompilerServices.MethodImpl(Runtime.CompilerServices.MethodImplOptions.NoInlining)> _
       Set(ByVal value As DateTime)
           CanWriteProperty(True)
           If Not _timeEnd.Equals(value) Then
               _timeEnd.Date = DateAdd(DateInterval.Year,
CInt(My.Resources.SqlMinYear), value.TimeOfDay)
           End If
       End Set

The purpose of SqlMinYear is to allow the UI to receive a time only and to
store it by appending SQL Server's min date. However, when I try to retrieve
this Resources string, I get this error:

"'My.Resources.SqlMinYear' is not declared or the module containing it is
not loaded in the debugging session."

I get the same thing if I try to get the value in the immediate window.

Any ideas?
Barry Gilbert - 13 Feb 2007 16:49 GMT
Never mind. It turns out that if I use Console.WriteLine, it does correctly
display the value. I don't understand why, but statements in the immediate
window don't always jive with what is returned by Console.Write.

Also, sorry for the triple post; it's some bug in my Firefox installation.

Barry

> In a Property Set statement, I'm trying to retrieve a value from My.Resources
> like this:
[quoted text clipped - 25 lines]
>
> Any ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.