Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7552411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:45:19+00:00 2026-05-30T10:45:19+00:00

I am creating a windows application which required Dynamic Connection String in the app

  • 0

I am creating a windows application which required Dynamic Connection String in the app starting (user need to provide db credentials through a form), After entering the connection credentials user redirected to new win form
Everything is working fine but how can I pass my dynamic connection to another form.

I tried to save it to App variable but I couldn’t (I think its read only)
Also I tried save it to registry but can’t retrieve values.

Is there any other option available ? like writing & retrieving ConString to a text file or XML

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:45:20+00:00Added an answer on May 30, 2026 at 10:45 am

    This how you can get and set registry values :

    Public Function GetRegistryValue(ByVal KeyName As String, Optional ByVal DefaultValue As Object = Nothing) As Object
            Dim res As Object = Nothing
            Try
                Dim k = My.Computer.Registry.CurrentUser.OpenSubKey("Software\YourAppName", True)
                If k IsNot Nothing Then
                    res = k.GetValue(KeyName, DefaultValue)
                Else
                    k = My.Computer.Registry.CurrentUser.CreateSubKey("Software\YourAppName")
                End If
                If k IsNot Nothing Then k.Close()
            Catch ' ex As Exception
                'PromptMsg(ex)
            End Try
            Return res
    End Function
    
    Public Sub SetRegistryValue(ByVal KeyName As String, ByVal _Value As Object)
            Try
                Dim k = My.Computer.Registry.CurrentUser.OpenSubKey("Software\YourAppName", True)
                If k IsNot Nothing Then
                    k.SetValue(KeyName, _Value)
                Else
                    k = My.Computer.Registry.CurrentUser.CreateSubKey("Software\YourAppName")
                    k.SetValue(KeyName, _Value)
                End If
                If k IsNot Nothing Then k.Close()
            Catch ' ex As Exception
                'PromptMsg(ex)
            End Try
    End Sub
    

    It’s working a 100%, If you please mark this answer as Right

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a Firefox extension, in which I want to iterate through the Application.windows
I am creating a C# Windows Mobile application that I need to programmatically invoke
I am creating a windows application which needs to send some sms to mobile
I am creating a Windows form application in C# which gets a set of
I'm currently in the process of creating a Windows service application which will monitor
I am creating Windows Application in C# in which I want to write in
i am creating windows application in C# in which i want to write in
I am creating a C# Windows application which is based on a medical inventory.In
I am creating a VC++2008 Windows Form Application which needs some classes from our
I am creating a VC++2008 Windows Form Application which needs to use some of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.