I’ve been looking on the website about the String connection and its parameters. I already implemented the connection with this code but I don’t know how to concatenate the parameters with user input.
Here’s my code :
Imports System
Imports System.Data
Imports System.Data.OracleClient
Module OracleConnect
Sub Main()
Dim connString As String = "server = o92; uid = java2s;password = password;"
'Create connection
Dim conn As New OracleConnection(connString)
Try
conn.Open()
Console.WriteLine("Connection Opened")
Console.WriteLine("Connection Properties")
Console.WriteLine("- ConnectionString : {0}", conn.ConnectionString)
Console.WriteLine("- ServerVersion : {0}", conn.ServerVersion)
Console.WriteLine("- State : {0}", conn.State)
Catch ex As OracleException
Console.WriteLine("Error: " & ex.ToString())
Finally
' Close Connection
conn.Close()
Console.WriteLine("Connection Closed")
End Try
End Sub
The point is I want to change the connection String with user input parameter so it will be a text box and the server and the password and also the listener will be following the user’s input.
Thank you very much
You could try a function like this, pass in the values of your TextBoxes;
usage would be.