[英]How to update my data sources on visual studio 2012 c#?
I am working on a windows form application c# and I put spaces inside my database title fields which meant I had to go back and put an '_' whereever there was a space, eg "First_Name". 我正在Windows窗体应用程序c#上工作,并且在数据库标题字段中放置了空格,这意味着我必须返回并在有空格的地方放置“ _”,例如“ First_Name”。
I done this but when I click refresh in the data source window in Visual studio it doesnt update the data set for some reason? 我这样做了,但是当我在Visual Studio的数据源窗口中单击“刷新”时,由于某种原因它没有更新数据集吗?
How do I update the data sets to have the titles include underscores in replace of the spaces? 如何更新数据集以使标题包含下划线代替空格?
Thanks 谢谢
enable Data migration using the package manager console (PMC) Check this link 使用程序包管理器控制台(PMC)启用数据迁移检查此链接
TO Enable Data migration in MVC (To be applied if the data model has been changed after it was created) 启用MVC中的数据迁移(如果在创建数据模型后对其进行了更改,则将被应用)
1.open PMC 1.打开PMC
2. Type Command Enable-Migrations -ContextTypeName YOURDBContext 2.键入命令Enable-Migrations -ContextTypeName YOURDBContext
3. Then Update-Database -Script -SourceMigration: $InitialDatabase 3.然后Update-Database -Script -SourceMigration:$ InitialDatabase
4. At last Update-Database -Verbose 4.最后更新数据库-详细
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.