当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - LINQ to SQL Classes & Datacontext are not created

问题描述:

Afternoon all

This is driving me nuts.

For no apparent reason (of course there must be one), my web project will no longer generate LINQ to SQL classes/data contexts!!!

I am going about the usual routine of right clicking the project, adding new item, selected LINQ to SQL classes, then dragging over a table from Server Explorer, saving and build but no...the bloody thing won't appear!!!

Does anyone know why this might be happening/what have I done wrong?

网友答案:

Figured it out.

Basically, NEVER rename any items.

I had previously been using OnlineReporting in one item, the name space when linq creates the classes was using this as it's namespace.

However, I then later changed this to Reporting but when the linq to sql generation occurred, it was still using the 'old' namespace.

I went into the designer.cs file, amended the name space to match the new format and it worked.

分享给朋友:
您可能感兴趣的文章:
随机阅读: