public static string connectionString = SQLUtil.getConnectionString();
public static List <DataObjects.StrInt1> GetCategories(string a, string b)
{
List<DataObjects.StrInt1> dataList = new List<DataObjects.StrInt1>();
string SqlCommand = $@"select catgeoryId from tbl_category Where lower(id)=@a and name=@b";
try
{
using(DbCommand objCmd = DBFactory.Instance.SqlUtil.Database.GetSqlStringCommand(SqlCommand))
{
DBFactory.Instance.SqlUtil.Database.AddInParameter(objCmd,"@id",DbType.AnsiString,a);
DBFactory.Instance.SqlUtil.Database.AddInParameter(objCmd,"@name",DbType.AnsiString,b);
using(IDataReader reader=DBFactory.Instance.SqlUtil.Database.ExecuteReader(objCmd))
{
while(reader.Read())
{
DataObjects.Str1Int1 dataObj = new DataObects.Str1Int1();
dataObj.ParamInt1 = reader[0].GetInt32();
dataObj.ParamInt1 = reader[1].ToString();
}
}
}
return dataList;
}
catch(Exception e)
{
throw e;
}
}