Hi
Instead of
public void BindWarrentyGrid()
{
UPWarrenty.Update();
UPWarrentyGrid.Update();
UPWarrentyGrid.Visible = true;
string AssetID = TXTAssetID.Text;
<big> TB_MasterAssetWarrenty warrenty =
DB.TB_MasterAssetWarrenties.FirstOrDefault(V => V.mAWA_mASS_NUPKId == mobjGenlib.ConvertLong(TXTAssetID.Text));</big>
dgWarrenty.DataSource = warrenty;
dgWarrenty.DataBind();
dgWarrenty.Visible = true;
}
I Changed like shown below :
public void BindWarrentyGrid()
{
UPWarrenty.Update();
UPWarrentyGrid.Update();
UPWarrentyGrid.Visible = true;
string AssetID = TXTAssetID.Text;
<big> var warrenty = from C in DB.TB_MasterAssetWarrenties
where C.mAWA_NUIsActive == 1 && C.mAWA_mASS_NUPKId == mobjGenlib.ConvertInt(AssetID)
select new { mAWA_NUPKId = C.mAWA_NUPKId, mAWA_mASS_NUPKId = C.mAWA_mASS_NUPKId, mAWA_VCCompanyname = C.mAWA_VCCompanyname, mAWA_VCSubitemname = C.mAWA_VCSubitemname, mAWA_VCReferencenumber = C.mAWA_VCReferencenumber };</big>
dgWarrenty.DataSource = warrenty;
dgWarrenty.DataBind();
dgWarrenty.Visible = true;
}
Now it works fine...