Advertisement
Guest User

Untitled

a guest
Dec 20th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. internal class MSSQLService : IDisposable
  2.     {
  3.         private const string SQL_USER = "";
  4.         private const string SQL_PASSWORD = "";
  5.  
  6.         private SqlConnection _connection;
  7.  
  8.         public MSSQLService(string server, string databaseName)
  9.         {
  10.             SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
  11.             builder.ApplicationName = "DataExchange.DocDoc";
  12.             builder.ConnectTimeout = 30;
  13.             builder.DataSource = server;
  14.             builder.InitialCatalog = databaseName;
  15.             builder.UserID = SQL_USER;
  16.             builder.Password = SQL_PASSWORD;
  17.             builder.PersistSecurityInfo = true;
  18.             _connection = new SqlConnection(builder.ConnectionString);
  19.         }
  20.  
  21.         public void UpdateCouponsStatus(IEnumerable<Coupon> coupons)
  22.         {
  23.             <...>
  24.         }
  25.  
  26.         public bool IsNeedSync(out DateTime lastSyncDate)
  27.         {
  28.             <...>
  29.         }
  30.  
  31.         public void RegistryError(string errorMessage)
  32.         {
  33.             <...>
  34.         }
  35.  
  36.         public void Dispose()
  37.         {
  38.             if (_connection != null)
  39.             {
  40.                 _connection.Dispose();
  41.                 _connection = null;
  42.             }
  43.         }
  44.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement