Question how to connect sql using ini file?

jocelyne_elkhoury

New member
Joined
Aug 12, 2013
Messages
1
Programming Experience
1-3
Hi all

how can i connect sql to vb.net using ini file? in other words i need to replace this code with an ini file:

dim connectionString as String ="Data Source=localhost;initial Catalog=Test;Integrated Security=true"
dim cn as SqlConnection = New SqlConnection(connectionString)

any suggestions?

Thank you:)
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,376
Location
Sydney, Australia
Programming Experience
10+
You certainly don't need to replace that code with an INI file. You might need to use the contents of the INI file in that code but, if that's the case, that's what you should have said. While IanRyder is strictly correct, if your file contains nothing but a connection string then it's not really an INI file, even if it has a ".ini" extension.

Please provide a FULL and CLEAR description of the whole problem. What EXACTLY does your INI file contain?

Apart from that, why are you using an INI file at all? .NET applications can and should generally store their connection strings in their own config file.
 

c3rb3ru5

Member
Joined
Oct 16, 2011
Messages
18
Location
O2PSoftLabs
Programming Experience
5-10
maybe this one sir

rfacc.ini
VB.NET:
[Options]
DBSTR    = Provider=MSDASQL;DSN=BILLING;UID=AVO_Acc;PWD=#vao8%acc0unt;
ErrDBSTR = 
LogLevel = 2

this vc++ program example. i think in game they using outside link as "Initialize" configuration. That make easy edit. but low of Security than using module in Visual Studio.
 
Top Bottom