Torna al Thread

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '==========AVVIO LA CONNESSIONE AL DATABASE========== Me.PRogressBar1.Visible = True Me.BackgroundWorker1.RunWorkerAsync() End Sub Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork connessione() End Sub Private Sub _connessione() Db.ConnectionString = "Data Source=SQLB10.WEBCONTROLCENTER.COM,1433;Network Library=DBMSSOCN;Initial Catalog=C59onlinefr;User ID=pippo;Password=pluto;" Db.Open() End Sub Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted If Db.State = ConnectionState.Closed = True Then ProgressBar1.Visible = False End If If Db.State = ConnectionState.Open = True Then ProgressBar1.Visible = False End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5