一、工程 生成 可能要改成x64
/// <summary> /// 最簡單測試 不用 /// </summary> /// <returns></returns> [HttpPost] public WebResponseContent GetTest1(string pkId) { string strEms_list_no = string.Empty; try { //從Oracle數據庫中讀取時間信息 string conn = string.Concat( @"Data Source=", @" (DESCRIPTION=", @" (ADDRESS_LIST=", @" (ADDRESS=", @" (PROTOCOL=TCP)", @" (HOST=jdepy-cluster.mflex.com)", @" (PORT=1521)", @" )", @" )", @" (CONNECT_DATA=", @" (SERVICE_NAME=SZBOOK)", @" )", @" );", @"Persist Security Info=True;", @"User Id=mid_cms;", @"Password=eport" ); //OracleConnection 被標註爲已過時 OracleConnection oc = new OracleConnection(conn); try { oc.Open(); //OracleCommand 被標註爲已過時 OracleCommand cmd = oc.CreateCommand(); cmd.CommandText = "select * from v_logistics_data where ems_list_no='" + pkId + "'"; OracleDataReader odr = cmd.ExecuteReader(); while (odr.Read()) { strEms_list_no = odr.GetString(0); //Console.WriteLine(odr.GetOracleDateTime(0).ToString()); } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { oc.Close(); } return webResponse.OK(null, strEms_list_no); } catch (Exception ex) { return webResponse.Error(ex.ToString()); } }