All pastes #605888 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-06 14:47 UTC
rendered paste body
 private void UpdateExternalDealerProfileAsync()
        {
            Deleg proc = UpdateExternalDealerProfile;
            System.IAsyncResult async = proc.BeginInvoke(null, null);
            proc.EndInvoke(async);
        }

        private void UpdateExternalDealerProfile()
        {
            SqlConnection objConnection = new SqlConnection(strConnection);
            SqlConnection objConnection2 = new SqlConnection(strConnection2);

            try
            {
                //Update Bosch Record
                objConnection2.Open();
                SqlCommand sqlComm = new SqlCommand("UpdateDealer", objConnection2);
                sqlComm.CommandType = CommandType.StoredProcedure;
                sqlComm.Parameters.AddWithValue("@DealerNumber", this.dealerNumber);
                sqlComm.Parameters.AddWithValue("@CompanyName", this.strCompanyName);
                sqlComm.Parameters.AddWithValue("@FirstName", this.strFirstName);
                sqlComm.Parameters.AddWithValue("@LastName", this.strLastName);
                sqlComm.Parameters.AddWithValue("@Title", this.strTitle);
                sqlComm.Parameters.AddWithValue("@Email", this.strEmail);
                sqlComm.Parameters.AddWithValue("@Phone1", this.phone1);
                sqlComm.Parameters.AddWithValue("@Phone2", this.phone2);
                sqlComm.Parameters.AddWithValue("@Address1", this.address1);
                sqlComm.Parameters.AddWithValue("@Address2", this.address2);
                sqlComm.Parameters.AddWithValue("@City", this.strCity);
                sqlComm.Parameters.AddWithValue("@State", this.strState);
                sqlComm.Parameters.AddWithValue("@Zip", this.zip);
                sqlComm.Parameters.AddWithValue("@URL", this.url);
                sqlComm.Parameters.AddWithValue("@SalesTax", this.tax);
                sqlComm.Parameters.AddWithValue("@PriceColumn", this.strPriceColumn);
                sqlComm.Parameters.AddWithValue("@ID", this.strID);
                sqlComm.ExecuteNonQuery();
                objConnection2.Close();

                //Turn off updated flag
                objConnection.Open();
                sqlComm = new SqlCommand("UpdateDealerUpdatedStatus", objConnection);
                sqlComm.CommandType = CommandType.StoredProcedure;
                objConnection.Close();
            }
            catch (SqlException ex)
            {
                //no internet connection. ignore.
                //throw new Exception(ex.ToString());
            }
            finally
            {
                objConnection.Dispose();
                objConnection2.Dispose();
            }
        }