Walaa wrote:
I'm not sure I understand you.
If you generate the mappings to an XML file, you have to use the code I've posted, I tried it in your repro and it works, and the grid displays the data without an error.
Whether to use an xml mappings or not, I'm not sure which is better, but I think it doesn't make any difference at runtime.
Really!!! but on my side it says "System.Data.SqlClient.SqlException: Invalid object name 'dbo.Products'."
Its really weired.
I enabled the debug option and its gives the error on binding;
nvalid object name 'dbo.Products'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'dbo.Products'.
Source Error:
Line 20: select p;
Line 21: GridView1.DataSource = products;
Line 22: GridView1.DataBind();
Line 23: }
Line 24: }
Source File: c:\Projects\TestProjects\LLBGenTest\LLBLGen\WebSite1\Default.aspx.cs Line: 22