Click here to Skip to main content
15,892,072 members
Home / Discussions / C#
   

C#

 
GeneralRe: Not able to set focus on the grid Pin
Stevo Z14-Mar-07 0:13
Stevo Z14-Mar-07 0:13 
GeneralRe: Not able to set focus on the grid Pin
Sivaprasad C14-Mar-07 0:23
Sivaprasad C14-Mar-07 0:23 
GeneralRe: Not able to set focus on the grid Pin
Stevo Z14-Mar-07 0:39
Stevo Z14-Mar-07 0:39 
GeneralRe: Not able to set focus on the grid Pin
Sivaprasad C14-Mar-07 0:52
Sivaprasad C14-Mar-07 0:52 
GeneralRe: Not able to set focus on the grid Pin
Stevo Z14-Mar-07 1:15
Stevo Z14-Mar-07 1:15 
Questiondeleting an sql database Pin
Keshav V. Kamat13-Mar-07 23:40
Keshav V. Kamat13-Mar-07 23:40 
AnswerRe: deleting an sql database Pin
Pete O'Hanlon13-Mar-07 23:48
mvePete O'Hanlon13-Mar-07 23:48 
GeneralRe: deleting an sql database Pin
Keshav V. Kamat14-Mar-07 0:04
Keshav V. Kamat14-Mar-07 0:04 
I got it how to do.
The reason why i was unable to drop the database was because it had dependencies with the default system tables whenever it was created. so i had to roll back the changes and the dependencies, after which i was able to drop it.

BTW, I didnt choose the database name in the connection. the initial catalog was left blank.


here is how.

SqlConnection connDeleteDatabase = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=; Packet Size = 32766;");
try
{
connDeleteDatabase.Open();
SqlCommand cmdDeleteDatabase = new SqlCommand("ALTER DATABASE Logger SET SINGLE_USER WITH ROLLBACK IMMEDIATE", connDeleteDatabase);
cmdDeleteDatabase.ExecuteNonQuery();
cmdDeleteDatabase = new SqlCommand("DROP DATABASE Logger", connDeleteDatabase);
cmdDeleteDatabase.ExecuteNonQuery();
}
catch (System.Exception exception)
{
MessageBox.Show(exception.Message);
}
finally
{
if (connDeleteDatabase.State == ConnectionState.Open)
connDeleteDatabase.Close();
}


thanks anyways.

Keshav Kamat Smile | :)
India

Questionc# remoting problem Pin
daserca13-Mar-07 23:37
daserca13-Mar-07 23:37 
QuestionHow to display default Form's non-client menu programaticly Pin
Stevo Z13-Mar-07 23:36
Stevo Z13-Mar-07 23:36 
QuestionAccess a variable Pin
Dothanhnam13-Mar-07 23:05
Dothanhnam13-Mar-07 23:05 
AnswerRe: Access a variable Pin
Keshav V. Kamat13-Mar-07 23:11
Keshav V. Kamat13-Mar-07 23:11 
AnswerRe: Access a variable Pin
darkcalin13-Mar-07 23:13
darkcalin13-Mar-07 23:13 
GeneralRe: Access a variable Pin
Keshav V. Kamat13-Mar-07 23:20
Keshav V. Kamat13-Mar-07 23:20 
GeneralRe: Access a variable Pin
Colin Angus Mackay14-Mar-07 0:39
Colin Angus Mackay14-Mar-07 0:39 
AnswerRe: Access a variable Pin
N a v a n e e t h13-Mar-07 23:18
N a v a n e e t h13-Mar-07 23:18 
GeneralRe: Access a variable Pin
Dothanhnam13-Mar-07 23:25
Dothanhnam13-Mar-07 23:25 
AnswerRe: Access a variable Pin
Keshav V. Kamat13-Mar-07 23:25
Keshav V. Kamat13-Mar-07 23:25 
GeneralRe: Access a variable Pin
Colin Angus Mackay14-Mar-07 0:43
Colin Angus Mackay14-Mar-07 0:43 
AnswerRe: Access a variable Pin
Colin Angus Mackay14-Mar-07 0:41
Colin Angus Mackay14-Mar-07 0:41 
QuestionHelp me! Pin
Dothanhnam13-Mar-07 22:42
Dothanhnam13-Mar-07 22:42 
AnswerRe: Help me! Pin
Keshav V. Kamat13-Mar-07 22:48
Keshav V. Kamat13-Mar-07 22:48 
GeneralRe: Help me! Pin
netJP12L14-Mar-07 5:53
netJP12L14-Mar-07 5:53 
QuestionPlease Very urgent - WEBDAV method - REgarding Pin
ArunkumarSundaravelu13-Mar-07 22:18
ArunkumarSundaravelu13-Mar-07 22:18 
Questionxml from dataTable *hwo can sole this??[modified] Pin
darkcalin13-Mar-07 22:10
darkcalin13-Mar-07 22:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.