Click here to Skip to main content
15,910,121 members
Home / Discussions / Database
   

Database

 
GeneralQuestion on Dataset v.s DataReader Pin
HahnTech25-Nov-04 4:20
HahnTech25-Nov-04 4:20 
GeneralRe: Question on Dataset v.s DataReader Pin
Steven Campbell25-Nov-04 5:04
Steven Campbell25-Nov-04 5:04 
GeneralDataGrid in a second Form Pin
realmontanakid25-Nov-04 3:31
realmontanakid25-Nov-04 3:31 
GeneralRe: DataGrid in a second Form Pin
Edbert P25-Nov-04 15:50
Edbert P25-Nov-04 15:50 
Generalproblem running Sql Server as localhost Pin
Hmitosh25-Nov-04 1:55
Hmitosh25-Nov-04 1:55 
GeneralRe: problem running Sql Server as localhost Pin
Steve S25-Nov-04 4:58
Steve S25-Nov-04 4:58 
GeneralA question about Microsoft DataGrid Control, Version 6.0(OLEDB) Pin
IsaacLitingjun24-Nov-04 21:25
IsaacLitingjun24-Nov-04 21:25 
GeneralRestore DB Pin
Anonymous24-Nov-04 8:58
Anonymous24-Nov-04 8:58 
i'm trying to restore a db from a windows app., but i had an error stating that the DB is in use and can't be restored.
can anyone help please ...

*********
CODE
********
public static void RestoreDB(string path)
{
string commandString="USE MASTER RESTORE DATABASE Guirguis FROM DISK = '"+path+"'"; //Guirguis : DB to restore
SqlConnection newConn=new SqlConnection();
newConn.ConnectionString="workstation id="+System.Environment.MachineName+";packet size=4096;integrated security=SSPI;data s" +"ource=\".\";persist security info=False;initial catalog=master";
command=new SqlCommand(commandString,newConn);

dbConnection.Close(); //connection may be using Guirguis
newConn.Open();

try
{
command.ExecuteNonQuery();
}
catch(Exception e)
{
newConn.Close();
throw new Exception(e.Message);
}
newConn.Close();
newConn.Dispose();
}
*******************

thanx
GeneralRe: Restore DB Pin
venadder24-Nov-04 10:52
venadder24-Nov-04 10:52 
GeneralAn exception caused by Primary Key Pin
sharonz24-Nov-04 1:59
sharonz24-Nov-04 1:59 
GeneralRe: An exception caused by Primary Key Pin
Colin Angus Mackay24-Nov-04 4:55
Colin Angus Mackay24-Nov-04 4:55 
GeneralAdd table, fields and records Pin
bouli23-Nov-04 17:05
bouli23-Nov-04 17:05 
GeneralRe: Add table, fields and records Pin
Colin Angus Mackay24-Nov-04 4:58
Colin Angus Mackay24-Nov-04 4:58 
Generalhelp Pin
Yulianto.23-Nov-04 15:43
Yulianto.23-Nov-04 15:43 
GeneralTime & DataGrid Pin
Mr.Cooper23-Nov-04 11:36
Mr.Cooper23-Nov-04 11:36 
GeneralRe: Time & DataGrid Pin
Mike Dimmick25-Nov-04 0:13
Mike Dimmick25-Nov-04 0:13 
GeneralFirst insert ignore adding records to Access Pin
PaleyX23-Nov-04 6:24
PaleyX23-Nov-04 6:24 
GeneralRecords are not visible Pin
Member 177285223-Nov-04 0:56
Member 177285223-Nov-04 0:56 
GeneralRe: Records are not visible Pin
Steven Campbell23-Nov-04 6:45
Steven Campbell23-Nov-04 6:45 
GeneralSELECT query with COUNT of another table that may have no matching records Pin
Luis Alonso Ramos22-Nov-04 14:47
Luis Alonso Ramos22-Nov-04 14:47 
GeneralRe: SELECT query with COUNT of another table that may have no matching records Pin
Mike Dimmick23-Nov-04 2:05
Mike Dimmick23-Nov-04 2:05 
GeneralRe: SELECT query with COUNT of another table that may have no matching records Pin
Luis Alonso Ramos23-Nov-04 7:10
Luis Alonso Ramos23-Nov-04 7:10 
GeneralDuration Field !!!!!!!!! Pin
Mr.Cooper22-Nov-04 13:08
Mr.Cooper22-Nov-04 13:08 
GeneralRe: Duration Field !!!!!!!!! Pin
Christian Graus22-Nov-04 13:41
protectorChristian Graus22-Nov-04 13:41 
Generalconnection to table and display results to labels Pin
jlawren722-Nov-04 9:42
jlawren722-Nov-04 9:42 

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.