12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data.SqlClient;
- namespace yrok2
- {
- class Class1
- {
- SqlConnection sqlConnection = new SqlConnection("Data Source=class31000;Initial Catalog=authorizationkhozeev;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;
- }
- }
- }
|