开发者

Deploy Windows Application with SQL database "security part"

i would like to Deploy my windows application written with c# (Express edition 2010) an开发者_运维技巧d SQL server express edition 2008 and i want to know how to do the following:

  1. The steps to deploy the Application and how to set all settings(i think with express edition there is only one way click once method, but how set the settings for it?

  2. after Deploy my application what i have to do to setup or install it in the customer machine(requirements for software side) to make it work?

  3. What is the best location to place my database files(MDF and LOg) in the customer machine c: or D: and how to prevent any one to access the database without using Application because the connection string is like that:

    "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\FamilyHistory.mdf;Integrated Security=True;User Instance=True"
    
  4. Finally i want to know how to make backup for the database from time to time , is there any automatic method to do that or i have to make manualy by copy it form the customer machine.


You can have a look at a number of deployment methods. You can use click once but i strongly advise using something like NSIS(open source). You can use a software HM NIS Edit(also free) that does the hard work for a .net project. Try it on your own machine and then you will know how to deploy. By client i take it you mean your customer rather than client/server type client?

the answer to three i believe (although i rarely do the old file sharing nowadays) that you should place the file in the temp folder in windows, however, i am willing to be wrong about that.

It depends on what data provider you are using however, you simply create a sqlcommand object(as i'm sure you know how) then enter in the backup sql something like:

BACKUP DATABASE AdventureWorks2008R2 
TO DISK = 'Z:\SQLServerBackups\AdvWorksData.bak'
WITH FORMAT;
GO

i hope that has helped.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜