没有合适的资源?快使用搜索试试~ 我知道了~
创建sdf数据库
5星 · 超过95%的资源 需积分: 42 99 下载量 172 浏览量
2012-09-02
22:13:14
上传
评论 2
收藏 2KB TXT 举报
温馨提示
试读
2页
C#操作通过编写创建表语句进行创建sdf数据库
资源推荐
资源详情
资源评论
/// <summary>
/// 创建sdf数据库
/// </summary>
/// <param name="path"></param>
/// <param name="al">创建数据表语句集合;
/// 如:"Create Table TAKESTOCKDT(FLOWID int IDENTITY(1,1) PRIMARY KEY,BOOKID nvarchar(20),BOOKNAME nvarchar(145),PRICE numeric(12,4),PUBLISHER nvarchar(32),STOREQTY integer,QTY integer)"</param>
private void BuildSdf(string path, ArrayList al)
{
if (System.IO.File.Exists(path))
{
System.IO.File.Delete(path);
}
//创建数据库
SqlCeEngine CeEng = new SqlCeEngine("Data Source="+path);
CeEng.CreateDatabase();
//提取当前程序的版本号
AssemblyName name = new AssemblyName();
name.Version = new Version("0.0.0");
Assembly a = Assembly.GetExecutingAssembly();
name = a.GetName();
//创建数据表
SqlCeConnection CeConn = new SqlCeConnection("Data Source=" + path);
try
{
SqlCeCommand CeCmd = CeConn.CreateCommand();
CeConn.Open();
//CeCmd.CommandText = "Create Table SETTING(WSLOCATION nvarchar(50),TIMEOUT integer,MAJOR integer,MINOR integer,BUILD integer)";
//CeCmd.ExecuteNonQuery();
/// 创建sdf数据库
/// </summary>
/// <param name="path"></param>
/// <param name="al">创建数据表语句集合;
/// 如:"Create Table TAKESTOCKDT(FLOWID int IDENTITY(1,1) PRIMARY KEY,BOOKID nvarchar(20),BOOKNAME nvarchar(145),PRICE numeric(12,4),PUBLISHER nvarchar(32),STOREQTY integer,QTY integer)"</param>
private void BuildSdf(string path, ArrayList al)
{
if (System.IO.File.Exists(path))
{
System.IO.File.Delete(path);
}
//创建数据库
SqlCeEngine CeEng = new SqlCeEngine("Data Source="+path);
CeEng.CreateDatabase();
//提取当前程序的版本号
AssemblyName name = new AssemblyName();
name.Version = new Version("0.0.0");
Assembly a = Assembly.GetExecutingAssembly();
name = a.GetName();
//创建数据表
SqlCeConnection CeConn = new SqlCeConnection("Data Source=" + path);
try
{
SqlCeCommand CeCmd = CeConn.CreateCommand();
CeConn.Open();
//CeCmd.CommandText = "Create Table SETTING(WSLOCATION nvarchar(50),TIMEOUT integer,MAJOR integer,MINOR integer,BUILD integer)";
//CeCmd.ExecuteNonQuery();
riyefu
- 粉丝: 2
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2013-2022vc运行命令库
- probleme.exe
- 基于python完成对csv文件的读取并且通过flask框架显示
- 基于SpringBoot的“体质测试数据分析及可视化”的设计与实现.zip
- c语言-c语言编程基础之leetcode题解第21题合并两个有序链表.zip
- 快速开发API服务的框架
- c语言-c语言编程基础之leetcode题解第20题有效的括号.zip
- c语言-c语言编程基础之leetcode题解第19题删除链表的倒数第N个结点.zip
- c语言-c语言编程基础之leetcode题解第17题电话号码的字母组合.zip
- c语言-c语言编程基础之leetcode题解第16题最接近的三数之和.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页