Mysql connection (1 Viewer)

ionutp23

Registered User.
Local time
Today, 06:25
Joined
Dec 23, 2019
Messages
30
Hi i'm new to vb and dont know to much any way i found a working mysql connection with vb (Code) i dont know how to explain better but what i need is
to add mysql details in my.settings which works fine like my.settings.server ,my.settings.user,my.settings.password,my.settings.db then use like this

GetSQLConnection = New MySqlConnection("datasource=my.settings.server;USER=my.settings.user;password=my.settings.password") but dont work.

i would appreciate any help even with teamviewer.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:25
Joined
Aug 30, 2003
Messages
36,118
If I understand correctly, concatenate the values:

"datasource=" & my.settings.server & ";USE R=" & my.settings.user & ";password=" & my.settings.password
 

ionutp23

Registered User.
Local time
Today, 06:25
Joined
Dec 23, 2019
Messages
30
If I understand correctly, concatenate the values:

"datasource=" & my.settings.server & ";USE R=" & my.settings.user & ";password=" & my.settings.password

Thank you now i get this error
Error 1 Comma, ')', or a valid expression continuation expected. C:\Users\Ionut\Documents\Visual Studio 2010\Projects\RoTV LIVE - Copy\RoTV LIVE\modFunctions.vb 30 157 RoTV LIVE




Public Function GetSQLConnection() As MySqlConnection
GetSQLConnection = New MySqlConnection("datasource=" & my.settings.dbserver & ";USE R=" & my.settings.dbuser & ";password=" & my.settings.dbpassword")

GetSQLConnection.Open()
End Function
 

ionutp23

Registered User.
Local time
Today, 06:25
Joined
Dec 23, 2019
Messages
30
Use a variable for the connection string and then use this so you can see how it's coming out:



thank you works resolved by adding one more at ther end "")

i see you are a good expert Thank you. will be ok if i may ask for your hel with next problems?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:25
Joined
Aug 30, 2003
Messages
36,118
Happy to help! Feel free to start a new thread if the next problem is unrelated to this one. I'd be happy to help with the new questions but there are many of us here that can help, and starting a new thread will maximize your chances of one of us seeing the new questions and will get you the quickest answer.
 

Users who are viewing this thread

Top Bottom