使用C#动态创建Sql / Oracle表的最佳方法是什么? [英] What is the best approach to create Sql/Oracle Table dynamically using C#?

查看:388
本文介绍了使用C#动态创建Sql / Oracle表的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用C#在Wpf中创建一个工具。



任何人都可以建议使用C#动态创建表的最佳方法。



如果您有任何疑问,请告诉我。





谢谢。

Hi,

I'm creating a tool in Wpf using C#.

Can anybody suggest a best approach to create a table dynamically using C#.

If you have any queries do let me know.


Thanks.

推荐答案

没有最佳方法。你有一份要求清单吗?



您可以提供一个文本框,用户可以在其中输入专栏名称。

A类型的下拉列表,即varchar等。



然后单击一个按钮,您可以根据用户选择的内容创建表。
There is no best approach. Do you have a list of requirements?

You can possibly provide a textbox where the user can type the name of the column.
A dropdown for the type i.e. varchar etc.

Then on click of a button, you can create table based on whatever the user has selected.

Mohammed Hameed写道:
Mohammed Hameed wrote:

假设我准备好了创建表脚本,现在我想通过C#代码运行这个脚本动态创建表而不是手动。服务器可以是Sql服务器或Oracle,它应该支持两个服务器。

Assume that I have the 'Create table' script ready, Now I want to run this script through C# code to create table dynamically instead of manual. The server can be a Sql server or Oracle, it should support both servers.





我不确定你的意思是写上面的单词,尤其是'创建表'脚本。如果 script 表示C#代码中的过程/函数,我建议你阅读有关重载方法和签名的内容。



3.6签名和重载 [ ^ ]

7.4.2重载决议 [ ^ ]

方法重载(C#教程) [ ^ ]

C# Overload(dotnetperls) [ ^ ]



I'm not sure what you mean writing above words, especially 'Create table' script. If script means procedure/function in C# code, i would suggest you to read about overloading methods and signatures.

3.6 Signatures and overloading[^]
7.4.2 Overload resolution[^]
Method overloading (C# tutorials)[^]
C# Overload (dotnetperls)[^]


你好,

点击这里 -

dynamically-choose-sql-server-or-oracle-database [ ^ ]


这篇关于使用C#动态创建Sql / Oracle表的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆