[newbie] Linq cannot find the tablename..
-
When running a tutorial project on LINQ, I'm getting an error: The table name property of LinqDataSource 'LinqDataSource1' must specify a table property or field on the data context type. I tried to set the TableName property to RegClient, which is the name of the actual table name of the database created within the project, however, VS does not seem to recognize it. From the horizontal dropdown next to LinqDataSource1.TableName the table name does not show up, which might mean that it was not configured. Any ideas? :confused: NOTE: Cannot paste code directly due to a network problem on the VM where the code resides. Reference book ASP.NET 3.5 - A Beginner's Guide written by William B. Sanders (2009).
Jon
-
When running a tutorial project on LINQ, I'm getting an error: The table name property of LinqDataSource 'LinqDataSource1' must specify a table property or field on the data context type. I tried to set the TableName property to RegClient, which is the name of the actual table name of the database created within the project, however, VS does not seem to recognize it. From the horizontal dropdown next to LinqDataSource1.TableName the table name does not show up, which might mean that it was not configured. Any ideas? :confused: NOTE: Cannot paste code directly due to a network problem on the VM where the code resides. Reference book ASP.NET 3.5 - A Beginner's Guide written by William B. Sanders (2009).
Jon
jon_80 wrote:
When running a tutorial project on LINQ, I'm getting an error: The table name property of LinqDataSource 'LinqDataSource1' must specify a table property or field on the data context type.
Can you please put the line of code?
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
-
When running a tutorial project on LINQ, I'm getting an error: The table name property of LinqDataSource 'LinqDataSource1' must specify a table property or field on the data context type. I tried to set the TableName property to RegClient, which is the name of the actual table name of the database created within the project, however, VS does not seem to recognize it. From the horizontal dropdown next to LinqDataSource1.TableName the table name does not show up, which might mean that it was not configured. Any ideas? :confused: NOTE: Cannot paste code directly due to a network problem on the VM where the code resides. Reference book ASP.NET 3.5 - A Beginner's Guide written by William B. Sanders (2009).
Jon
If you use object of Table class, it is must to provide the actual table map attribute on the header. I think the DBML you made doesnt have the actual tables in the database. Just change the connectionstring and create the table structure as mentioned in the DBML. This error will wiped out automatically....
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET Templates