Zbiór zmian 1003 dla trunk/BazaReklam/Logowanie.cs
- Data:
- 2010-01-14 17:07:10 (16 years ago)
- Pliki:
-
- 1 zmodyfikowane
-
trunk/BazaReklam/Logowanie.cs (zmodyfikowane) (6 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/BazaReklam/Logowanie.cs
r936 r1003 9 9 public partial class Logowanie : Form 10 10 { 11 12 #region Fields (2)13 14 11 private bool loginResult; 15 12 private readonly SqlConnectionStringBuilder sqlBldr = new SqlConnectionStringBuilder(); 16 13 17 #endregion Fields18 19 #region Constructors (1)20 21 14 public Logowanie() 22 15 { … … 32 25 bazyComboBox.SelectedIndex = 0; 33 26 } 34 35 #endregion Constructors36 27 37 28 #region Methods (6) … … 174 165 reader.Dispose(); 175 166 } 176 if (command != null) command.Dispose(); 167 168 if (command != null) 169 command.Dispose(); 177 170 178 171 if (conn != null) … … 196 189 sqlBldr.UserID = textBox1.Text; 197 190 sqlBldr.Password = textBox2.Text; 198 sqlBldr.ConnectTimeout = 200000;191 sqlBldr.ConnectTimeout = 180;// 200000; 199 192 sqlBldr.ApplicationName = "BazaReklam_v" + Application.ProductVersion; 200 193 … … 238 231 private static bool SprawdzWersje() 239 232 { 240 SqlCo mmand cmd= null;233 SqlConnection conn = null; 241 234 try 242 235 { 243 cmd = new SqlCommand("SELECT ver FROM dbo.app WHERE [name]='BazaReklam'"); 244 cmd.Connection = 245 new SqlConnection("Data Source=" + ConnString.GetDataSource() + ";Initial Catalog=Applications;Persist Security Info=True;User=updater;Password=UpdateSolution;Application Name=BazaReklam_v" + Application.ProductVersion + ";"); 246 247 248 cmd.Connection.Open(); 249 string ver = (string) cmd.ExecuteScalar(); 250 cmd.Connection.Close(); 236 conn = new SqlConnection("Data Source=" + ConnString.GetDataSource() + ";Initial Catalog=Applications;Persist Security Info=True;User=updater;Password=UpdateSolution;Application Name=BazaReklam_v" + Application.ProductVersion + ";"); 237 conn.Open(); 238 239 SqlCommand cmd = conn.CreateCommand(); 240 cmd.CommandText = "SELECT ver FROM dbo.app WHERE [name]='BazaReklam'"; 241 string ver = (string)cmd.ExecuteScalar(); 251 242 252 243 if (ver.Trim() != Application.ProductVersion) … … 261 252 finally 262 253 { 263 if (cmd != null) 264 { 265 if (cmd.Connection != null) 266 { 267 cmd.Connection.Close(); 268 cmd.Connection.Dispose(); 269 } 270 cmd.Dispose(); 254 if (conn != null) 255 { 256 conn.Close(); 257 conn = null; 271 258 } 272 259 }
