1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace muskafidi_de
- {
- class DataBase
- {
- SqlConnection sqlConnection = new SqlConnection(@"Data Source=Class31000;Initial Catalog=06_muskafidi_de;Integrated Security=True");
- public void openConnetction()
- {
- if (sqlConnection.State == System.Data.ConnectionState.Closed)
- {
- sqlConnection.Open();
- }
- }
- public void closeConnetction()
- {
- if (sqlConnection.State == System.Data.ConnectionState.Open)
- {
- sqlConnection.Close();
- }
- }
- public SqlConnection getConnection()
- {
- return sqlConnection;
- }
- }
- }
|