コード例 #1
0
ファイル: FormMain.cs プロジェクト: sergiygladkyy/Mriya
        private void buttonbuttonGetSPDataDal_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime t1 = DateTime.Now;

                tableProfilesSPDal.ReadSqlSPProfiles(Properties.Settings.Default.spSqlConnectionString);
                dataGridViewSPDal.DataSource = tableProfilesSPDal.GetProfiles();
                dataGridViewSPDal.Refresh();

                DateTime t2 = DateTime.Now;
                labelSPDalStatus.Text = string.Format("Received {0} records, t = {1:N2} sec",
                                                      tableProfilesSPDal.Count, (double)((t2 - t1).TotalMilliseconds / 1000));
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("The error was occured while importing from sharepoint server '{0}'\nThe error message:{1}\n",
                                              Properties.Settings.Default.spSiteUrl, ex.Message), "Error!", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }