Wednesday, June 13, 2012
Thursday, May 24, 2012
Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)
I got this when i use linq query
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
{
var res = from gu in db.tblForlkliftGasUtils
join g in db.tblGas on gu.GasID equals g.GasID
select new GasUtilGas { GasNo = g.GasNumber};
return res;
}
It seems like g.GasNumber is a nullable int field in the database. Change the model to this:
public class GasUtilGas
{
public int? GasNo { get; set; }
}
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
{
var res = from gu in db.tblForlkliftGasUtils
join g in db.tblGas on gu.GasID equals g.GasID
select new GasUtilGas { GasNo = g.GasNumber};
return res;
}
It seems like g.GasNumber is a nullable int field in the database. Change the model to this:
public class GasUtilGas
{
public int? GasNo { get; set; }
}
Friday, May 11, 2012
The data source does not support server-side data paging
You can't use an IQueryable object to data bind to a GridView and still use Paging and Sorting. You must return a List to the GridView using the ToList() method.
Thanks
Sunday, May 6, 2012
Monday, April 23, 2012
no parameterless constructor defined for this object - nopcommerce 2.4
Register your service classes in Nop.Web.Framework.DependencyRegistrar.
Thanks
Thanks
Monday, February 20, 2012
Image upload with CKEditor.
Image upload with CKEditor.
My latest issue was how to integrate CKFinder for image upload in CKEditor. Here the solution.
1. Download CKEditor and extract in your web folder root.
2. Download CKFinder and extract withing ckeditor folder.
3. Then add references to the CKEditor, CKFinder and put
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server"></CKEditor:CKEditorControl>
to your aspx page.
4. In code behind page OnLoad event add this code snippet
protected override void OnLoad(EventArgs e)
{
CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
_FileBrowser.BasePath = "ckeditor/ckfinder/";
_FileBrowser.SetupCKEditor(CKEditorControl1);
}
5. Edit Confic.ascx file.
public override bool CheckAuthentication()
{
return true;
}
// Perform additional checks for image files.
SecureImageUploads = true;
Thanks
My latest issue was how to integrate CKFinder for image upload in CKEditor. Here the solution.
1. Download CKEditor and extract in your web folder root.
2. Download CKFinder and extract withing ckeditor folder.
3. Then add references to the CKEditor, CKFinder and put
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server"></CKEditor:CKEditorControl>
to your aspx page.
4. In code behind page OnLoad event add this code snippet
protected override void OnLoad(EventArgs e)
{
CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
_FileBrowser.BasePath = "ckeditor/ckfinder/";
_FileBrowser.SetupCKEditor(CKEditorControl1);
}
5. Edit Confic.ascx file.
public override bool CheckAuthentication()
{
return true;
}
// Perform additional checks for image files.
SecureImageUploads = true;
Thanks
Tuesday, February 14, 2012
ASP.NET 4.0 potentially dangerous Request.Form value was detected
put <pages validateRequest="false" />
Subscribe to:
Posts (Atom)
I Built a New Kind of Number Puzzle Game (And You Can Play It Free)
For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...
-
I have tried data-gramm="false" and hiding it through CSS, but neither of these solutions has worked. If anyone can resolve this i...
-
Microsoft Graph API provides powerful capabilities to interact with Microsoft 365 services. In this guide, we’ll explore how to create calen...
-
Microsoft Graph API is a powerful tool that allows developers to access a wide range of Microsoft 365 services, including Outlook and Calend...