Click here to Skip to main content
16,006,348 members
Home / Discussions / Database
   

Database

 
QuestionTrigger issue Pin
Howard Richards7-Aug-08 2:59
Howard Richards7-Aug-08 2:59 
AnswerRevised billing logic Pin
David Mujica7-Aug-08 3:44
David Mujica7-Aug-08 3:44 
GeneralRe: Revised billing logic Pin
Howard Richards7-Aug-08 4:47
Howard Richards7-Aug-08 4:47 
AnswerRe: Trigger issue Pin
Wendelius7-Aug-08 8:34
mentorWendelius7-Aug-08 8:34 
QuestionNeed some advice on a good "practice" SQL server Pin
MarkB7777-Aug-08 0:52
MarkB7777-Aug-08 0:52 
AnswerRe: Need some advice on a good "practice" SQL server Pin
Howard Richards7-Aug-08 2:45
Howard Richards7-Aug-08 2:45 
AnswerRe: Need some advice on a good "practice" SQL server Pin
Mycroft Holmes7-Aug-08 17:34
professionalMycroft Holmes7-Aug-08 17:34 
QuestionAttach database failed for Server 'computername\Instance1'. Give Error on VISTA but successfully run on XP Pin
Rupsaa7-Aug-08 0:43
Rupsaa7-Aug-08 0:43 
hi all,
i installed SQL Server in silent mode as following

str = "C:\SQLEXPRFiles\setup.exe /qb ADDLOCAL=ALL INSTANCENAME=Instance1 SECURITYMODE=SQL SAPWD=password DISABLENETWORKPROTOCOLS=0 "<br />
       <br />
        Shell(str, AppWinStyle.Hide, True)


After that i want to attach database to this server as following

Dim ComputerName As String = My.Computer.Name<br />
<br />
        Dim MainServer As Server = New Server(ComputerName & "\Instance1")<br />
        With MainServer.ConnectionContext<br />
            .LoginSecure = False<br />
            .Login = "sa"<br />
            .Password = password <br />
            .Connect()<br />
            If MainServer.Databases.Contains(mydatabase) Then<br />
            Else<br />
                Dim logstr As String<br />
                Dim datastr As String<br />
                datastr = Application.StartupPath & "\mydatabase.mdf"<br />
                logstr = Application.StartupPath & "\mydatabase_log.ldf"<br />
                'Attach the database<br />
                Dim sc As StringCollection<br />
                sc = New StringCollection<br />
                sc.Add(datastr)<br />
                sc.Add(logstr)<br />
                Try<br />
                    MainServer.AttachDatabase(mydatabase, sc, ComputerName & "\Owner")<br />
                    MsgBox("Database Attached")<br />
                Catch ex As Exception<br />
                    MsgBox(ex.Message.ToString)<br />
                End Try<br />
            End If<br />
            .Disconnect()<br />
            .AutoDisconnectMode = AutoDisconnectMode.DisconnectIfPooled<br />
<br />
        End With

but MainServer.AttachDatabase statement give error on VISTA but successfully run on XP . Inner exception is {"An exception occurred while executing a Transact-SQL statement or batch."}

any body have idea where i am wrong ?

modified on Friday, August 8, 2008 5:07 AM

Questionsql server management studio express 32 bit or 64 bit.... Pin
new2pgrmg6-Aug-08 22:27
new2pgrmg6-Aug-08 22:27 
AnswerRe: sql server management studio express 32 bit or 64 bit.... Pin
SimulationofSai6-Aug-08 23:08
SimulationofSai6-Aug-08 23:08 
QuestionCreate Login/User when Install SQL Server In Silent mode Pin
Rupsaa6-Aug-08 22:16
Rupsaa6-Aug-08 22:16 
QuestionHow to Edit & Read binary data on SQL 2005 Pin
jdfgdg6-Aug-08 20:56
jdfgdg6-Aug-08 20:56 
AnswerRe: How to Edit & Read binary data on SQL 2005 Pin
topcatalpha6-Aug-08 21:36
topcatalpha6-Aug-08 21:36 
GeneralRe: How to Edit & Read binary data on SQL 2005 Pin
jdfgdg6-Aug-08 22:07
jdfgdg6-Aug-08 22:07 
GeneralRe: How to Edit & Read binary data on SQL 2005 Pin
topcatalpha6-Aug-08 22:47
topcatalpha6-Aug-08 22:47 
QuestionAbout Attach database Pin
nelsonpaixao6-Aug-08 14:51
nelsonpaixao6-Aug-08 14:51 
JokeRe: About Attach database Pin
Paul Conrad7-Aug-08 18:12
professionalPaul Conrad7-Aug-08 18:12 
QuestionHow get file date with scripts Pin
topcatalpha6-Aug-08 5:07
topcatalpha6-Aug-08 5:07 
AnswerRe: How get file date with scripts Pin
Wendelius6-Aug-08 9:02
mentorWendelius6-Aug-08 9:02 
AnswerRe: How get file date with scripts Pin
Ashfield6-Aug-08 20:52
Ashfield6-Aug-08 20:52 
GeneralRe: How get file date with scripts Pin
topcatalpha6-Aug-08 21:24
topcatalpha6-Aug-08 21:24 
QuestionCreate login On SQL Server Pin
Rupsaa6-Aug-08 4:19
Rupsaa6-Aug-08 4:19 
AnswerRe: Create login On SQL Server Pin
Ashfield6-Aug-08 4:25
Ashfield6-Aug-08 4:25 
Questionadding the time component of two dates Pin
balaji.t6-Aug-08 1:12
balaji.t6-Aug-08 1:12 
AnswerRe: adding the time component of two dates Pin
Wendelius6-Aug-08 8:24
mentorWendelius6-Aug-08 8:24 

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.