V
V
Vladimir Yurchenkov2021-08-05 20:47:18
SQL
Vladimir Yurchenkov, 2021-08-05 20:47:18

How to implement reading from sql.ini?

Hey!

I have just an application that connects to ASE Sybase DBMS and checks some data.
The connection string looks like this (I will write in one line):

AseConnection connect = new AseConnection("Data Source=host;port=4105;Database=master;Uid=login;Pwd=password;");


In total, I need to poll more than 50 servers, which are displayed simply in the listbox with the result. For example: server - status.

By default, all coordinates in ASE are stored in the interfaces file, but you can use the sql.ini file, which stores these coordinates in the same form:

[NAME_SERVER]
master=TCP,host, port
query=TCP,host, port

[NAME_SERVER]
master=TCP,host, port
query=TCP,host, port

[NAME_SERVER]
master=TCP,host, port
query=TCP,host, port

and so on.
How do they read such a "text" file in C# in order to take host and port by name NAME_SERVER?

I found something close here , but my lines are not settings and all the lines for reading are the same.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Yurchenkov, 2021-08-05
@EPIDEMIASH

In general, I decided to cut the ini file a little and do it like this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question