mohamed ajmeer

mohamed ajmeer

  • NA
  • 28
  • 60.7k

c# 2008 & Sql 2008 ,create dynamic database using script

Apr 3 2011 1:27 AM

hai

My task is creating database dynamically that is run time , i enter Servername,databasename,username,password in to textbox and click create database button ,the database to be create.

 Iam adding Textfile.txt in to my web site and write below code :this is sample code

 Note: I should use Textfile.txt in my project

.............................................................................................

IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Horizongov')

DROP DATABASE [Horizongov]

GO

CREATE DATABASE [Horizongov]

GO

...........................................................................................

how can i call  above Text file in to my c# coding give some examples




Answers (1)