Click here to Skip to main content
15,916,180 members
Home / Discussions / Database
   

Database

 
GeneralRe: Avoid using cursors inside Store procedure - why? Pin
MarkWagner811-Aug-08 9:24
MarkWagner811-Aug-08 9:24 
GeneralRe: Avoid using cursors inside Store procedure - why? Pin
Manas Bhardwaj11-Aug-08 10:54
professionalManas Bhardwaj11-Aug-08 10:54 
Questionupload image in data base.. Pin
amit201111-Aug-08 5:31
amit201111-Aug-08 5:31 
AnswerRe: upload image in data base.. Pin
Blue_Boy11-Aug-08 5:36
Blue_Boy11-Aug-08 5:36 
AnswerRe: upload image in data base.. Pin
Manas Bhardwaj11-Aug-08 5:38
professionalManas Bhardwaj11-Aug-08 5:38 
QuestionBackup failed on VISTA but successfully run on XP Pin
sunil goyalG11-Aug-08 4:28
sunil goyalG11-Aug-08 4:28 
GeneralRe: Backup failed on VISTA but successfully run on XP Pin
SimulationofSai11-Aug-08 5:08
SimulationofSai11-Aug-08 5:08 
GeneralRe: Backup failed on VISTA but successfully run on XP [modified] Pin
sunil goyalG11-Aug-08 21:13
sunil goyalG11-Aug-08 21:13 
i use same Server (SQL Server 2005 Express) for both OS . User is same since i use following procedure to install SQL Server,attach database and create login and User

str = Application.StartupPath & "\SQLEXPR32\setup.exe /qb ADDLOCAL=ALL INSTANCENAME=" & InstanceName & " SECURITYMODE=SQL SAPWD=sapassword DISABLENETWORKPROTOCOLS=0 "<br />
            Shell(str, AppWinStyle.Hide, True)<br />
            System.Threading.Thread.Sleep(5000)<br />
            Dim MainServer As Server = New Server(ComputerName & "\" & InstanceName)<br />
            With MainServer.ConnectionContext<br />
                .LoginSecure = True<br />
                .ConnectionString = "Server=" & ComputerName & "\" & InstanceName & " ;Trusted_Connection=Yes"<br />
                Try<br />
                    .Connect()<br />
                Catch ex As Exception<br />
                    Application.Exit()<br />
                End Try<br />
                If MainServer.Databases.Contains(DatabaseName) Then<br />
                Else<br />
                    Dim logstr As String<br />
                    Dim datastr As String<br />
                    datastr = Application.StartupPath & "\V.mdf"<br />
                    logstr = Application.StartupPath & "\V_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(DatabaseName, sc)<br />
                    Catch ex As Exception<br />
                        MsgBox(ex.Message.ToString)<br />
                    End Try<br />
                End If<br />
<br />
                If MainServer.Logins.Contains(LoginName) Then<br />
<br />
                Else<br />
                    Dim NewLogin As Login = New Login(MainServer, LoginName)<br />
                    NewLogin.LoginType = LoginType.SqlLogin<br />
                    NewLogin.DefaultDatabase = DatabaseName<br />
                    NewLogin.Create(LoginPassword)<br />
<br />
                    Dim db As New Database<br />
                    db = MainServer.Databases(DatabaseName)<br />
                    Dim DBUser As User = New User(db, UserName)<br />
                    DBUser.UserType = UserType.SqlLogin<br />
                    DBUser.Login = LoginName<br />
                    DBUser.Create()<br />
                    DBUser.AddToRole("db_Owner")<br />
<br />
                End If<br />
                .Disconnect()<br />
            End With


above code works fine on both OS (XP and VISTA)

modified on Tuesday, August 12, 2008 3:23 AM

QuestionConvert to hours Pin
Agweet11-Aug-08 2:39
Agweet11-Aug-08 2:39 
AnswerRe: Convert to hours Pin
Colin Angus Mackay11-Aug-08 2:49
Colin Angus Mackay11-Aug-08 2:49 
GeneralRe: Convert to hours Pin
Manas Bhardwaj11-Aug-08 4:56
professionalManas Bhardwaj11-Aug-08 4:56 
GeneralRe: Convert to hours Pin
Ashfield11-Aug-08 5:08
Ashfield11-Aug-08 5:08 
GeneralRe: Convert to hours Pin
PIEBALDconsult14-Aug-08 4:08
mvePIEBALDconsult14-Aug-08 4:08 
QuestionHow to wirte this query Pin
varshavmane11-Aug-08 1:12
varshavmane11-Aug-08 1:12 
AnswerRe: How to wirte this query Pin
Ashfield11-Aug-08 1:26
Ashfield11-Aug-08 1:26 
GeneralRe: How to wirte this query Pin
varshavmane11-Aug-08 1:46
varshavmane11-Aug-08 1:46 
GeneralRe: How to wirte this query Pin
Ashfield11-Aug-08 3:09
Ashfield11-Aug-08 3:09 
GeneralRe: How to wirte this query Pin
varshavmane11-Aug-08 3:26
varshavmane11-Aug-08 3:26 
GeneralRe: How to wirte this query Pin
Ashfield11-Aug-08 4:39
Ashfield11-Aug-08 4:39 
GeneralRe: How to wirte this query Pin
Blue_Boy11-Aug-08 5:39
Blue_Boy11-Aug-08 5:39 
QuestionStored Procedure not Found but There(Strange) Pin
Vimalsoft(Pty) Ltd11-Aug-08 0:22
professionalVimalsoft(Pty) Ltd11-Aug-08 0:22 
AnswerRe: Stored Procedure not Found but There(Strange) Pin
Paddy Boyd11-Aug-08 2:10
Paddy Boyd11-Aug-08 2:10 
GeneralRe: Stored Procedure not Found but There(Strange) Pin
Vimalsoft(Pty) Ltd11-Aug-08 3:05
professionalVimalsoft(Pty) Ltd11-Aug-08 3:05 
QuestionApplication Hang when DB down Pin
krishnan.s10-Aug-08 20:07
krishnan.s10-Aug-08 20:07 
AnswerRe: Application Hang when DB down Pin
Mycroft Holmes10-Aug-08 20:23
professionalMycroft Holmes10-Aug-08 20:23 

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.