C#哪里dbml的文件从何而来? [英] C# where does the dbml file come from?
问题描述
目前我正在学习C#和LINQ。我有很多关于他们的问题。基本上,我需要一步步的教程。
-
我想在
DBML
文件是数据库的配置文件。如果我双击DBML
VS文件将在设计图中打开它。我可以创建/删除/修改此处表?我可以使用添加新项目
添加LINQ to SQL类
获得的dbml
文件? -
接下来是什么?生成数据库表?生成SQL脚本?生成CS文件?什么时候?怎么样?
该DBML文件没有在相关的数据库服务器所有。这是一个完全客户端的东西。它本质上是一组有关数据库中的表和如何你将它们映射到.NET对象的信息。
当然,你也可以从数据库中拖动一个表,并具有Visual Studio自动推断出一些信息给你,但改变的文件,不会影响数据库。您可以从头开始创建一个DBML文件,而无需任何数据库了。
在内部,DBML文件很简单,是由Visual Studio送入一个自定义工具,并生成一个XML文件代表从它的数据库中的LINQ对象模型的.cs
文件。
I am currently learning C# and LINQ. I have lots of questions about them. Basically, I need a step by step tutorial.
I suppose the
dbml
file is the configuration file of the database. If I double click thedbml
file VS will open it in a design diagram. Can I create/delete/modify tables here? I can useadd new item
to add theLINQ to SQL Classes
to get adbml
file?What's next? Generate tables in database? Generate SQL script? Generate cs files? When? How?
The DBML file is not related to the database server at all. It's a completely client side thing. It's essentially a set of information about your tables in the database and how you're going to map them to .NET objects.
Of course, you can drag a table from a database and have Visual Studio infer some information for you automatically, but changing the file will not affect the database. You can create a DBML file from scratch without any database too.
Internally, the DBML file is simply an XML file that's fed into a custom tool by Visual Studio and generates .cs
files representing the LINQ object model for your database from it.
这篇关于C#哪里dbml的文件从何而来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!