|
-
Sep 29th, 2007, 05:19 AM
#1
Thread Starter
Hyperactive Member
setting datatabase offline/online using C#
Hello,
How to set a particular database in a offline/online mode from C#
Thanks
-
Sep 29th, 2007, 07:49 AM
#2
Thread Starter
Hyperactive Member
Re: setting datatabase offline/online using C#
 Originally Posted by sureshvijayan
Hello,
How to set a particular database in a offline/online mode from C#
Thanks
I got the answer :
sqlCreateDBQuery = "ALTER DATABASE databasename SET OFFLINE";
sqlCreateDBQuery = "ALTER DATABASE databasename SET ONLINE";
I have another question ? from VB.NET/C# how could we know a database if offline or online mode ?
-
Oct 1st, 2007, 01:45 PM
#3
Re: setting datatabase offline/online using C#
What database are you using?
-
Oct 2nd, 2007, 02:03 AM
#4
Thread Starter
Hyperactive Member
Re: setting datatabase offline/online using C#
 Originally Posted by Hack
What database are you using?
SQL SERVER 2005
I have a new problem ... i am able to give database offline by checking it is online or offline from C#..... no my problem ... if i set database offline ... i am not getting that db's name in select query for making it to online
SqlCommand sCom = sCon.CreateCommand();
sCom.CommandText = "sp_databases";
sCom.CommandType = CommandType.StoredProcedure;
SqlDataAdapter sqlAdapter = new SqlDataAdapter();
sqlAdapter.SelectCommand = sCom;
DataSet ds = new DataSet();
how to get the db's which is in offline ...
Last edited by sureshvijayan; Oct 11th, 2007 at 03:21 AM.
gh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|