Click here to Skip to main content
15,905,614 members
Home / Discussions / Database
   

Database

 
GeneralRe: import HOST file into a table Pin
solutionsville27-Nov-07 3:34
solutionsville27-Nov-07 3:34 
GeneralRe: import HOST file into a table [modified] Pin
pmarfleet27-Nov-07 3:57
pmarfleet27-Nov-07 3:57 
AnswerRe: import HOST file into a table Pin
solutionsville27-Nov-07 4:04
solutionsville27-Nov-07 4:04 
Questionupdate a field in a specified record in sql from asp.net Pin
Big Ralph27-Nov-07 0:44
Big Ralph27-Nov-07 0:44 
QuestionBreakPoints in Stored Procedures Pin
Zuhair Rizvi27-Nov-07 0:38
Zuhair Rizvi27-Nov-07 0:38 
AnswerRe: BreakPoints in Stored Procedures Pin
Vasudevan Deepak Kumar27-Nov-07 0:43
Vasudevan Deepak Kumar27-Nov-07 0:43 
GeneralRe: BreakPoints in Stored Procedures Pin
Zuhair Rizvi27-Nov-07 0:54
Zuhair Rizvi27-Nov-07 0:54 
QuestionRestore Database from C# Pin
tr_thorn26-Nov-07 20:23
tr_thorn26-Nov-07 20:23 
Hi ,

I can restore my db from SQL server Management with this script;
RESTORE DATABASE [LIDER] FROM DISK = N'E:\OyunTakip\database\LIDER.BAK' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10
GO

but i cant do the same thing from C#.

SqlConnection baglantim = new SqlConnection("data source=THORN\\SQLEXPRESS; database=LIDER; integrated security=SSPI");
baglantim.Open();
string cmdText = "RESTORE DATABASE" + " LIDER" + " FROM DISK = 'E:\\OyunTakip\\database\\LIDER.BAK'" + " WITH MOVE 'LIDER' TO 'e:\\Oyuntakip\\database\\LIDER.mdf' " + ",MOVE 'LIDER_Log' TO 'E:\\Oyuntakip\\database\\LIDER_log.ldf'" + ",REPLACE";

SqlCommand komut = new SqlCommand(cmdText,baglantim);

komut.ExecuteNonQuery();

Getting this error ;
RESTORE cannot process database 'LIDER' because it is in use by this session. It is recommended that the master database be used when performing this operation.
RESTORE DATABASE is terminating abnormally.

i cant solve it help pleasEEEe ;(


AnswerRe: Restore Database from C# Pin
SimulationofSai26-Nov-07 21:11
SimulationofSai26-Nov-07 21:11 
GeneralRe: Restore Database from C# Pin
tr_thorn26-Nov-07 22:49
tr_thorn26-Nov-07 22:49 
GeneralRe: Restore Database from C# Pin
Colin Angus Mackay26-Nov-07 22:52
Colin Angus Mackay26-Nov-07 22:52 
GeneralRe: Restore Database from C# Pin
SimulationofSai27-Nov-07 0:16
SimulationofSai27-Nov-07 0:16 
GeneralRe: Restore Database from C# Pin
tr_thorn27-Nov-07 20:44
tr_thorn27-Nov-07 20:44 
GeneralRe: Restore Database from C# Pin
SimulationofSai27-Nov-07 22:14
SimulationofSai27-Nov-07 22:14 
QuestionFetching rows in cursors Pin
mgr_2k726-Nov-07 19:20
mgr_2k726-Nov-07 19:20 
AnswerRe: Fetching rows in cursors Pin
Joe26-Nov-07 20:57
Joe26-Nov-07 20:57 
GeneralRe: Fetching rows in cursors Pin
mgr_2k726-Nov-07 21:58
mgr_2k726-Nov-07 21:58 
GeneralRe: Fetching rows in cursors Pin
Pete O'Hanlon26-Nov-07 22:39
mvePete O'Hanlon26-Nov-07 22:39 
GeneralRe: Fetching rows in cursors Pin
andyharman26-Nov-07 23:29
professionalandyharman26-Nov-07 23:29 
GeneralRe: Fetching rows in cursors Pin
Vasudevan Deepak Kumar27-Nov-07 2:43
Vasudevan Deepak Kumar27-Nov-07 2:43 
GeneralRe: Fetching rows in cursors Pin
mgr_2k727-Nov-07 19:13
mgr_2k727-Nov-07 19:13 
QuestionError in Insert statement Pin
prithaa26-Nov-07 19:08
prithaa26-Nov-07 19:08 
AnswerRe: Error in Insert statement Pin
N a v a n e e t h26-Nov-07 19:47
N a v a n e e t h26-Nov-07 19:47 
AnswerRe: Error in Insert statement Pin
Devan Nadar26-Nov-07 23:54
Devan Nadar26-Nov-07 23:54 
QuestionHow to connect to the MS Access database? Pin
mddev26-Nov-07 17:18
mddev26-Nov-07 17:18 

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.