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 / Windows Forms / Design Time / February 2005

Tip: Looking for answers? Try searching our database.

Initialisation Code - Strings with Null Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Camel - 13 Feb 2005 12:35 GMT
Hi,

I have been extending the following code sample -

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/v
bnet08262002.asp


Somewhere along the line though, when the DataMember variable is
initialised in generated code, it's default value is null (not "" like
I thought it would be - considering the default value). Here's my
slightly updated DataMember property code :

private string vDataMember = "";
[
    Category("Data"),
    DefaultValue(""),
    Editor("System.Windows.Forms.Design.DataMemberListEditor,System.Design",
typeof(System.Drawing.Design.UITypeEditor))
]
public string DataMember
{
    get { return(vDataMember); }
    set
        {
            vDataMember = value;
                                   
            SetSource();
            if ( vAutoDiscover )
                DoAutoDiscover();
            DataBind();
        }
} /* DataMember */

Can anybody provide me with some insights?

Regards,

Camel
joeycalisay - 14 Feb 2005 09:29 GMT
> private string vDataMember = "";

Are you sure that you are setting the string vDataMember field to an empty
string initially?  Mr. Loftka's example does not, perhaps you forgot to
initialize it to an empty string contrary to your posted message.

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Hi,
>
> I have been extending the following code sample -

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/v
bnet08262002.asp


> Somewhere along the line though, when the DataMember variable is
> initialised in generated code, it's default value is null (not "" like
[quoted text clipped - 27 lines]
>
> Camel

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.