Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnB_Click(object sender, EventArgs e)
- {
- cboToExternal.Items.Clear();
- sqlInfoFetcher2 = new BackgroundWorker();
- sqlInfoFetcher2.DoWork += new DoWorkEventHandler(sqlInfoFetcher2_DoWork);
- sqlInfoFetcher2.RunWorkerCompleted += new RunWorkerCompletedEventHandler(sqlInfoFetcher2_RunWorkerCompleted);
- sqlInfoFetcher2.RunWorkerAsync();
- }
- void sqlInfoFetcher2_DoWork(object sender, DoWorkEventArgs e)
- {
- string connectionString = "Data Source=CLSUTER;Initial Catalog=Contacts;user id=sa;password=sa; Asynchronous Processing=true";
- string query = "SELECT DISTINCT First_Name + ' ' + Last_Name AS Expr1 FROM dbo.NAME WHERE (Last_Name LIKE 'B%')";
- e.Result = FetchDataFromDB(connectionString, query);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement