Hope the below modified code will definitely of help to you :-
First of all include the header
System.Collections.Generic;
Then here is the modified code:
public List<businessobj.tables.getlocal> GetItem(object TransId)
{
try
{
List<businessobj.tables.getlocal> objGetLocalList = new List<businessobj.tables.getlocal>();
string spName = "spGetLocal";
Database db = DatabaseFactory.CreateDatabase(ConnectionString);
DbCommand dbCommand = db.GetStoredProcCommand(spName);
db.AddInParameter(dbCommand, "@billId", DbType.Int32, ((int)TransId));
DataTable dt = new DataTable();
dt = db.ExecuteDataSet(dbCommand).Tables[0];
foreach(DataRow dr in dt.Rows)
{
BusinessObj.Tables.GetLocal objGetLocal = new BusinessObj.Tables.GetLocal();
objGetLocal=(BusinessObj.Tables.GetLocal)FillRecords(dr, objGetLocal);
objGetLocalList.Add(objGetLocal);
}
return objGetLocalList;
}
}
Tried my best give you a working copy of code, still if it is not working i hope you will get the proper idea on how to accomplish your goal.
Happy coding.