开发者

Linq-To-SQL CreateDatabase doesn't create stored procedures

to-SQL DataContext and I run:

datacontext.CreateDatabase()

This works fine.

Recently I dragged a stored procedure onto the methods pane. I was thinking this stored procedure was now part of the datacontext and woul开发者_运维百科d get regenerated when creating the database.

It doesn't seem to. Does anyone know why or how to make it happen?


The DataContext.CreateDatabase method creates a replica of the database only to the extent of the information encoded in the object model. Mapping files and attributes from your object model might not encode everything about the structure of an existing database. Mapping information does not represent the contents of user-defined functions, stored procedures, triggers, or check constraints. This behavior is sufficient for a variety of databases.

SPs not part of that http://msdn.microsoft.com/en-us/library/bb399420.aspx


To my knowledge stored procedures must be declared in the Sql Server Management Studio (or such tool) and can'e be done via LINQ.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜