123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Data.SqlClient;
- namespace oootorg
- {
- class Database
- {
- SqlConnection sqlConnection = new SqlConnection(@"Data Source=class31000;Initial Catalog=OOOTORG_Lebedenko;Integrated Security=True;");
- public void openConnection()
- {
- if (sqlConnection.State == System.Data.ConnectionState.Closed)
- {
- sqlConnection.Open();
- }
- }
- public void closeConnection()
- {
- if (sqlConnection.State == System.Data.ConnectionState.Open)
- {
- sqlConnection.Close();
- }
- }
- public SqlConnection GetConnection()
- {
- return sqlConnection;
- }
- }
- }
|