How to create a DataTable in C# and how to add rows?(如何在 C# 中创建 DataTable 以及如何添加行?)
问题描述
如何在 C# 中创建数据表?
How do create a DataTable in C#?
我是这样做的:
如何查看DataTable的结构?
How do I see the structure of DataTable?
现在我想为 Name
添加 ravi,为 Marks
添加 500.我该怎么做?
Now I want to add ravi for Name
and 500 for Marks
. How can I do this?
推荐答案
代码如下:
要查看结构,或者我将其改写为架构,您可以通过执行以下操作将其导出到 XML 文件.
To see the structure, or rather I'd rephrase it as schema, you can export it to an XML file by doing the following.
要仅导出架构/结构,请执行以下操作:
To export only the schema/structure, do:
此外,您还可以导出数据:
Additionally, you can also export your data:
这篇关于如何在 C# 中创建 DataTable 以及如何添加行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!