Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class MSSQLService : IDisposable
- {
- private const string SQL_USER = "";
- private const string SQL_PASSWORD = "";
- private SqlConnection _connection;
- public MSSQLService(string server, string databaseName)
- {
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
- builder.ApplicationName = "DataExchange.DocDoc";
- builder.ConnectTimeout = 30;
- builder.DataSource = server;
- builder.InitialCatalog = databaseName;
- builder.UserID = SQL_USER;
- builder.Password = SQL_PASSWORD;
- builder.PersistSecurityInfo = true;
- _connection = new SqlConnection(builder.ConnectionString);
- }
- public void UpdateCouponsStatus(IEnumerable<Coupon> coupons)
- {
- <...>
- }
- public bool IsNeedSync(out DateTime lastSyncDate)
- {
- <...>
- }
- public void RegistryError(string errorMessage)
- {
- <...>
- }
- public void Dispose()
- {
- if (_connection != null)
- {
- _connection.Dispose();
- _connection = null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement