C# 用SQL新建数据库
1. 程序如下:
string str = "Create Database " + "DBname";
string con = "Data Source=10.0.0.249\\sql2005;Initial Catalog=master;Persist Security Info=True;User ID=sa;Password=sa";
SqlConnection myConn = new SqlConnection(con);
SqlCommand myCommand = new SqlCommand(str, myConn);
try
{
myConn.Open();
myCommand.ExecuteNonQuery();
Console.WriteLine("SQL 语句执行完成。", "MyProgram");
}
catch (System.Exception ex)
{
Console.WriteLine(ex.ToString(), "MyProgram");
}
finally
{
if (myConn.State == ConnectionState.Open)
{
myConn.Close();
相关文档:
1、 打开pl/sql 中tools-preferences,设置Connection中的Oracle Home为oracle9,OCI library为oracle9 如图
2、
将oralce10目录下的tnsnames.ora文件里面的所要导出的oralce10的服务配置 复制到oracle9目录下的tnsnames.ora文件里面
ORCL =
(DESCRIP ......
SQL Select Into语句
The SELECT INTO Statement
SELECT INTO 语句
The SELECT INTO statement is most often used to create backup copies of tables or for archiving records.
SELECT INTO语句常用来给数据表建立备份或是历史档案。
Syntax
语法
SELECT column_name(s) INTO newtable [IN externaldatabase] ......
C#生成com组件,供asp调用
一、vs2005—新建项目—C#类库
类库源码如下(包含接口,类,事件接口):
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data.SqlClient;
using System.Runtime.InteropServices;
namespace entryclass
{
  ......
我们知道,在SQL SERVER中有Bit, Float, Int , Char等等一系列的数据类型,而在DOT NET中,有Boolean,Double,Int 32,String等数据类型与之对应。 也就是说,数据库中的数据类型与DOT NET的数据类型之间,有一个映射关系。下表是他们的映射关系:
dot net中的数据类型 &n ......
2008数据库附加
/*
网上看到的整理了一下。
原文地址http://database.51cto.com/art/201003/190984.htm
在SQL Server 7.0中,微软推出了sp_attach_db和sp_attach_single_file_db系统存储过程。
它对于SQL Server数据库管理员执行下面的任务是非常方便的:
1 使用sp_attach_d ......