i have text file with fixed length data text file line is
07010001090560000201711061250160000472100100000001090560298609999MMBSLR/2017000063/SBP/BI-MUAJJAL SLR ACC 000002017000063PKR10000000062872.16001.000000000000000062872.16OBBBBRRRRSDDDDDDDDVTTTTTTIQQQ00
"
I have a model class where we have setter and setters for model.
namespace Model
{
public class FileData
{
private string _Transaction_ID;
public String Transaction_ID
{
get
{
return _Transaction_ID;
}
set
{
_Transaction_ID= value;
}
}
}
public bool Save(Model.IBRFileData FileData)
{
this._Sql.AddInParameter(command, PARAM_Transation_ID, DbType.String, FileData.Transation_ID,
#endregion
try
{
this._Sql.ExecuteNonQuery(command);
retunval = true;
}
catch (Exception ex)
{
log error to database
retunval = false;
}
return retunval;
}
File Data is inserted into database using DAL . question here is from interface when file data is inserted into database using DAL if unique constraint error occurred
then where should i log this exception ? i want to make a log of exception for every row which is inserted n db and get error.
where should i write a code for exception logging in DAL or in code behind where data is inserted one by one through loop?
What I have tried:
i have text file with fixed length data text file line is
<pre>07010001090560000201711061250160000472100100000001090560298609999MMBSLR/2017000063/SBP/BI-MUAJJAL SLR ACC 000002017000063PKR10000000062872.16001.000000000000000062872.16OBBBBRRRRSDDDDDDDDVTTTTTTIQQQ00
"
I have a model class where we have setter and setters for model.
namespace Model
{
public class FileData
{
private string _Transaction_ID;
public String Transaction_ID
{
get
{
return _Transaction_ID;
}
set
{
_Transaction_ID= value;
}
}
}
public bool Save(Model.IBRFileData FileData)
{
this._Sql.AddInParameter(command, PARAM_Transation_ID, DbType.String, FileData.Transation_ID,
#endregion
try
{
this._Sql.ExecuteNonQuery(command);
retunval = true;
}
catch (Exception ex)
{
log error to database
retunval = false;
}
return retunval;
}
File Data is inserted into database using DAL . question here is from interface when file data is inserted into database using DAL if unique constraint error occurred
then where should i log this exception ? i want to make a log of exception for every row which is inserted n db and get error.
where should i write a code for exception logging in DAL or in code behind where data is inserted one by one through loop?