用DataRow的Select()方法获取DataTable中的数据并返回字符串

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
posted @ 2012-03-07 09:34  mebius  阅读(2373)  评论(0编辑  收藏  举报