Results 1 to 4 of 4

Thread: initializing variable

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    initializing variable

    How do you initialize a variable that is in a module?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    same way you initialize a variable anywhere.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    in my module I have:
    VB Code:
    1. Public strCon As String = "Provider=MSDAORA;Password=" & LogonInfo.Mx_Password & ";User ID=" & LogonInfo.Mx_Logon & ";Data Source=dbatest"
    2.     Public objCon As New OleDbConnection(strCon)

    when I debug and and place the mouse curser over:
    LogonInfo.Mx_Logon
    LogonInfo.Mx_Password

    they have the correct values that I need, but when I place the cursor over (strcon) those values are missing in the string?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  4. #4
    Lively Member Tygur's Avatar
    Join Date
    Jul 2002
    Posts
    108
    My best guess is that LogonInfo.Mx_Logon and LogonInfo.Mx_Password didn't have the correct values when strCon was initialized, but they got their values later. I suggest you set strCon to whatever value it has to be after you set LogonInfo.Mx_Logon and LogonInfo.Mx_Password instead of right when you declare it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width