public BMS_DAL.DS.BMSDS.TVesselsDataTable GetVessel() { using (BMS_DAL.DS.BMSDSTableAdapters.TVesselsTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TVesselsTableAdapter()) { try { return(ta.GetData()); } catch (Exception ex) { throw ex; } } }
static void GetData(object arg) { using (BMS_DAL.DS.BMSDSTableAdapters.TVesselsTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TVesselsTableAdapter()) { System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); string r = string.Empty; try { var dt = ta.GetData(); r = string.Format("rows{0}", dt.Count); } catch (Exception ex) { r = ex.Message; } stopWatch.Stop(); System.Console.WriteLine(string.Format("T:{0} {1} {2}", arg, r, stopWatch.ElapsedMilliseconds)); } }