想要在Windows应用程序中创建数据库 [英] want to create a database in windows application

查看:78
本文介绍了想要在Windows应用程序中创建数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

谁能告诉我如何在Windows应用程序中创建数据库以及如何检索它.
Thnx

问候,
Vishavdeep Goyal

Hello,

Can anyone tell me please how to create database in windows application and how to retrieve it.
Thnx

Regards,
Vishavdeep Goyal

推荐答案

是.


任何特定类型的数据库? MsSQL,MySQL,SQLCE,SqlLite,Oracle,...
您想放入任何东西吗?
检索时,您想使用它做什么?

您是否尝试过阅读讲义?
您考虑过Google吗?

您实际上真的做了任何事情吗?
Yes.


Any particular type of database? MsSQL, MySQL, SQLCE, SqlLite, Oracle,...
Anything you want to put in it, in particular?
Anything you want to do with it when you retrieve it?

Have you tried reading your lecture notes?
Have you considered Google?

Have you actually done anything at all yourself?


您需要尝试这样的事情:


You need to try something like this:


using (SqlConnection con = new SqlConnection(@"Data Source=yourServerName\SQLEXPRESS;Integrated Security=True;"))
           {
               SqlCommand cmd = new SqlCommand("CREATE DATABASE MyDataBase",con);
               con.Open();
               cmd.ExecuteNonQuery();
           }



希望对您有所帮助



Hope this helps


尝试此

这篇关于想要在Windows应用程序中创建数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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