root in the deployement
-
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 -
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 bestMohammed 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 :-)