New Members FAQ
Talk to Webmaster Tony John
The type not mapped as a table
12 Jul 2012
this is my code
string cnstr = ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString;
cn = new SqlConnection(cnstr);
dc = new DataContext(cn);
Table<aprole> dt1 = dc.GetTable<aprole>();//Error The type 'aprole' is not mapped as a Table.
var role = from c in dt1 where c.rolename == "Reviewer" select c;
foreach (var dtvalue in role)
Response.Write("table" + dtvalue);
aprole is a class name ..
everything has fine, where i want to give the table name (in the database i have table name aprole)
i have to fetch data from that table only..
Date: 12/Jul/2012 Rating:
I will suggest to use LINQ-To-SQL Class (DataContext) for the database and it will map your table (just one) which ever you want.
Below is the article
"Please don't forget to Rate this answer if you found it usefull"
This thread is locked for new responses. Please post your comments and questions as a
If required, refer to the URL of this page in your
Where to start Linq?
Where and why we use LINQ
Return to Discussion Forum
Post New Message
Binding with repeater
From where to start? what is it LinQ?
Readind data from XML and copying to an array or object
Dynamic Query creation in Linq.
Follow us on Twitter:
Last 7 Days
Asheej T K
Awards & Gifts
Articles Rss Feeds
Forum Rss Feeds
Revenue Sharing sites
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.