简体   繁体   English

如何在Visual Studio 2012 C#上更新我的数据源?

[英]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.

相关问题 在 Visual Studio 2019 中替换 C# 的数据源 - Replacing data sources for C# in visual studio 2019 清除ListBox中的数据并在Visual Studio 2012 C#XAML中重新加载 - Clearing Data in ListBox and Reload in Visual Studio 2012 C# XAML 如何在Visual Studio 2012 C#中使用数据/值成员从组合框执行搜索操作 - How to preform search operation from combobox using data/value member in Visual Studio 2012 C# 在c#下使用Visual Studio 2012创建.sql脚本,以及如何运行它? - create .sql script with Visual Studio 2012 at c# and how run it? 如何在Win 7 visual Studio 2012中的C#中禁用#if DEBUG - how to disable #if DEBUG in C# at Win 7 visual studio 2012 如何在Visual Studio 2012中指定特定的texbox填充c# - how to specify an specific texbox to fill in c# in Visual Studio 2012 如何在Visual Studio 2012 C#项目中使用SQLConfigDataSource - How to Use SQLConfigDataSource in a Visual Studio 2012 C# Project 如何将C#安装到Visual Studio 2012 Ultimate - How To Install C# to Visual Studio 2012 Ultimate 如何在Visual Studio 2012中部署具有所有依赖项的C#项目 - How to Deploy c# project with all dependencies in visual studio 2012 C#Visual Studio 2012如何显示类成员和方法? - C# Visual Studio 2012, how to show class members and methods?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM