Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! (Pro...  two Linq to Sql bugs
Previous Previous
 
Next Next
New Post 7/21/2008 10:55 PM
User is offline Saeed Alhs
17 posts
saeedalhs.net
10th Ranked


two Linq to Sql bugs 

Creating a new dotnetnuke module using LinqToSql based on LinqThings4Sale example, I created a table named Emplyees (from Northwind database) and then use this table in a Linq to SQL Class (IDE: Visual Web Developer 2008 Express Edition), I faced with 2 problems below:

  1. Singularization Problem: The wizard automatically converts table's Plural name to Singular noun --> Employees converted to Employee  --> There will arise some errors like " Bad type casting", "Unable to convert data types", ...
    • Solution: Rename the table class by hand to correspond it with it's database defined table name.
  2. Self Returning Association: Employees table has field " ReportsTo" which refers to EmployeeID in the same table, compiling the web site results error: Error 1 'Employees': member names cannot be the same as their enclosing type E:\Visual Studio 2008 Express\Websites\LinqWebSite\App_Code\ActivitiesManagementSystem\ActivitiesManagementSystem.designer.cs 623 32 http://...
    • Soultion: Just remove the self-association relation.

 

 
New Post 7/22/2008 5:50 AM
User is offline Michael Washington
2848 posts
ADefWebserver.com
5th Ranked










Re: two Linq to Sql bugs 

 Saeed Alhs wrote

  1. Singularization Problem: The wizard automatically converts table's Plural name to Singular noun --> Employees converted to Employee  --> There will arise some errors like " Bad type casting", "Unable to convert data types", ...
    • Solution: Rename the table class by hand to correspond it with it's database defined table name.
  2. Self Returning Association: Employees table has field " ReportsTo" which refers to EmployeeID in the same table, compiling the web site results error: Error 1 'Employees': member names cannot be the same as their enclosing type E:\Visual Studio 2008 Express\Websites\LinqWebSite\App_Code\ActivitiesManagementSystem\ActivitiesManagementSystem.designer.cs 623 32 http://...
    • Soultion: Just remove the self-association relation. 

1. The singularization is not the problem, it does that with all tables that end in an "s". It must conflict with another class named Employee somewhere. What was the exact conflict?

2. If you do need self association use Linq to Entities. This is still in Beta at the moment.



Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! (Pro...  two Linq to Sql bugs
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


PartnerPoint | Community of Microsoft Partners
PartnerPoint is one of the largest and most active online communities of Microsoft Partners worlwide with over 8,000 members.
www.PartnerPoint.com
Web Valley
Website design, Database development
www.webvalley.com
UK DotNetNuke CMS installation, hosting & support
UK based installation, branding, customising, integration, hosting, training, support and maintenance services for DotNetNuke
www.deburca.co.uk

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP