1. 程式人生 > >用DataRow的Select()方法獲取DataT…

用DataRow的Select()方法獲取DataT…

public static string GetPartTypeID(string partTypeNo)

{

  try

  {

     DataTable dt=GetPartType();

     DataRow[] drs=dt.Select("PartTypeNo='"+partTypeNo+"'");

     if(drs.Length>0)

     {

       return drs[0]["PartTypeID"].ToString();

     }

     return "";

  }

  catch(Exception ex)

  {

   throw(ex);

  }

}

  #region 獲取成品型別
  /// <summary>
  /// 獲取成品型別
  /// </summary>
  /// <returns></returns>
  public static DataTable GetPartType()
  {
   try
   {
    return BrainSoft.PRC.Process.SqlDataProvider.GetPartType();
   }
   catch(Exception ex)
   {
    throw(ex);
   }
  }
  #endregion