Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. root in the deployement

root in the deployement

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasevisual-studiosecurity
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohammed Amine
    wrote on last edited by
    #1

    Hi, i know that the title wasn't good but anyway i will explain as good as i can to let you see the problem i have my two data files .Mdf & .Ldf in a folder named MyData in the bin folder where i have ma .exe file in the vs.net i have this Public Con As SqlConnection Public Sub main() bda: Con = New SqlConnection("data source=ORDI_AMINE;integrated security=SSPI;initial catalog=GHotel") CmdAt.Connection = Con Try Con.Open() Catch ex As Exception Con.Close() Con.ConnectionString = "data source=ORDI_AMINE;integrated security=SSPI;initial catalog=master" Con.Open() CmdAt.CommandText = "exec sp_attach_db @dbname = 'GHotel',@filename1 = '" & Application.StartupPath & "\MyData\GHotel_Data.MDF', @filename2 = '" & Application.StartupPath & "\MyData\GHotel_Log.LDF'" CmdAt.ExecuteNonQuery() Con.Close() GoTo bda ' Con.Open() End Try FrmBien.ShowDialog() End Sub GHotel is my database when i do setup for ma app. it gaves me a bug by the opposite it works very well when i'm working in vs.net you can try it if you want to can you tell me where is the problem ?? ah i forgot i added a folder named MyData to the app. Folder when i was creating the setup & i added in this folder the two files .Mdf & .Ldf thank you very much :) try to be good if you can't be the best

    S 1 Reply Last reply
    0
    • M Mohammed Amine

      Hi, i know that the title wasn't good but anyway i will explain as good as i can to let you see the problem i have my two data files .Mdf & .Ldf in a folder named MyData in the bin folder where i have ma .exe file in the vs.net i have this Public Con As SqlConnection Public Sub main() bda: Con = New SqlConnection("data source=ORDI_AMINE;integrated security=SSPI;initial catalog=GHotel") CmdAt.Connection = Con Try Con.Open() Catch ex As Exception Con.Close() Con.ConnectionString = "data source=ORDI_AMINE;integrated security=SSPI;initial catalog=master" Con.Open() CmdAt.CommandText = "exec sp_attach_db @dbname = 'GHotel',@filename1 = '" & Application.StartupPath & "\MyData\GHotel_Data.MDF', @filename2 = '" & Application.StartupPath & "\MyData\GHotel_Log.LDF'" CmdAt.ExecuteNonQuery() Con.Close() GoTo bda ' Con.Open() End Try FrmBien.ShowDialog() End Sub GHotel is my database when i do setup for ma app. it gaves me a bug by the opposite it works very well when i'm working in vs.net you can try it if you want to can you tell me where is the problem ?? ah i forgot i added a folder named MyData to the app. Folder when i was creating the setup & i added in this folder the two files .Mdf & .Ldf thank you very much :) try to be good if you can't be the best

      S Offline
      S Offline
      Steve Pullan
      wrote on last edited by
      #2

      Mohammed Amine wrote:

      when i do setup for ma app. it gaves me a bug by the opposite it works very well when i'm working in vs.net you can try it if you want to

      Huh? What is the error you are getting? Posting code without the accompanying error is useless. BTW, have you tried removing the leading '\' from the path you are constructing? ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups