String is converted into invalid UTF-8 characters when passed into model from controller
Huzaifa Sajid
0
Reputation points
Controller:
DataTable dtt = new CommonModel().ManualQuerySelect("select isnull(ReportTitle,'Journal Voucher') from gen_VoucherTypes where VoucherType = 6 and LogSourceID = 0", clsCommon.AccountsnewConnectionString).Tables[0];
Model:
public DataSet ManualQuerySelect(string Query, string NewConnection, int CommandTimeout=0)
{
if(NewConnection != "")
{
SqlDatabase db = new SqlDatabase(NewConnection);
DbCommand SPCommand = db.GetSqlStringCommand(Query);
SPCommand.CommandTimeout = CommandTimeout;
return db.ExecuteDataSet(SPCommand);
}
else
{
DataSet ds = new DataSet();
return ds;
}
}
Issue is that i get 漀甀挀栀攀爀䤀䐀 㴀 笀 紀Ⰰ 䴀愀渀愀最攀 㴀 笀紀Ⰰ 倀愀爀琀礀吀椀琀氀攀 㴀 in Model string Query parameter
Sign in to answer