public string RouteName(string Code) { string Name = ""; string ConnectionDBStr = ((DatabaseSettings)ConfigurationManager.GetSection("dataConfiguration")).DefaultDatabase; MaintainRoute co_main = new MaintainRoute(ConnectionDBStr); if (Code != "") { ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(Code); //輸入查詢值 DataTable Dt = co_main.QueryForSLP(ParameterList); if (Dt.Rows.Count > 0) { Name = Dt.Rows[0]["ROUTE_NAME"].ToString().Trim(); } else { Name = "查無資料"; } } return Name; }
private void GetRouteName(string strRoute, out string strRouteName) { strRouteName = ""; try { PIC.VDS2G.GFM.STM.MaintainRoute BCO = new PIC.VDS2G.GFM.STM.MaintainRoute(ConntionDB); ParameterList.Clear(); ParameterList.Add(strRoute); DataTable Dt = BCO.QueryForSLP(ParameterList); if (Dt.Rows.Count > 0) { strRouteName = Dt.Rows[0]["ROUTE_NAME"].ToString().Trim(); } else { strRouteName = ""; } } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }