很简单啊
SQL Server2000!

解决方案 »

  1.   

    没搞错把!!是我没有说清楚么??我使用C#做的ASP应用程序。用代码实现!到底应该怎么做??
    应该用到system.data.sqlclient中的对象吧?如果连接数据库在用SQl对其操作,我会。但是创建数据库之前不会有连接(因为还没有数据库呢)我应该怎样使用Ado.net中的对象??
      

  2.   

    不是你没说清楚system.data.sqlclient没有可以创建数据库的方法
      

  3.   

    C#不能做ASP
    只能做ASP.NET!!!!
      

  4.   

    刚好昨天做了一个安装程序用C#建立数据库.
    数据库没有建立之前在MSSQL中有MASTER数据库,连接串的数据库为MASTER
    再用COMMAND建立指定的数据库,
    用ChangeDatabase转到新建的数据库。
    用一系列SQL建立对应的表或其他对象。
      

  5.   

    1、建立连接
    System.Data.SqlClient.SqlConnection oConn=new System.Data.SqlClient.SqlConnection("data source="+this.DbServer.Text+";initial catalog=master;user id="+this.UserId.Text+";password="+this.Password.Text);     
    2、//建立数据库
    System.Data.SqlClient.SqlCommand oComm=oConn.CreateCommand();
    oComm.CommandText="CREATE DATABASE "+this.DBName.Text ; 
    try
    {
    oComm.ExecuteNonQuery(); 
    }
    catch
    {
    System.Windows.Forms.MessageBox.Show(this,"建立数据库出错,请手工建立指定的数据库","信息提示",System.Windows.Forms.MessageBoxButtons.OK);
    oComm.Dispose();
    3、转换到新建的数据库
    oConn.ChangeDatabase(this.DBName.Text);  
    4、建立其他对象
    oCommand.CommandText="if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AddAnalyzeRecord]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)\n";
    oCommand.CommandText+="drop procedure [dbo].[AddAnalyzeRecord]\n";
    oCommand.ExecuteNonQuery(); 
    oCommand.CommandText="\n";
    oCommand.CommandText+="if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AddVisitErrorLog]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)\n";
    oCommand.CommandText+="drop procedure [dbo].[AddVisitErrorLog]\n";
    oCommand.ExecuteNonQuery();
    oCommand.CommandText="\n";
    oCommand.CommandText+="if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AddVisitLog]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)\n";
    oCommand.CommandText+="drop procedure [dbo].[AddVisitLog]\n";
    oCommand.ExecuteNonQuery();
    oCommand.CommandText="\n";
    oCommand.CommandText+="if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AnalyzeRecord]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)\n";
    oCommand.CommandText+="drop table [dbo].[AnalyzeRecord]\n";
    oCommand.ExecuteNonQuery();
    oConn.Close();
    oConn.Dispose(); 
    }
      

  6.   

    to : happybirds(happybirds)data source="+this.DbServer.Text+“
    中的this.DbServer.Text是指的什么??
      

  7.   

    this.DbServer.Text是你将新建数据库的SQL服务器。this.UserId.Text是用户ID,