Sic.Framework-Nanjing-Baishi/MECF.Framework.Common/MECF/Framework/Common/DBCore/DataQuery.cs

43 lines
694 B
C#
Raw Normal View History

2023-04-13 11:51:03 +08:00
using System;
using System.Collections.Generic;
using System.Data;
using Aitex.Core.RT.DBCore;
using Aitex.Core.RT.Log;
namespace MECF.Framework.Common.DBCore
{
public static class DataQuery
{
public static DataTable Query(string sql)
{
DataTable result = new DataTable("result");
try
{
2023-06-27 15:46:42 +08:00
DataSet dataSet = DB.ExecuteDataSet(sql);
2023-04-13 11:51:03 +08:00
if (dataSet != null)
{
result = dataSet.Tables[0];
}
}
catch (Exception ex)
{
LOG.Write(ex);
}
return result;
}
public static bool ExcuteTransAction(List<string> sql)
{
try
{
return DB.ExcuteTransAction(sql);
}
catch (Exception ex)
{
LOG.Write(ex);
}
return true;
}
}
}