Click here to Skip to main content
16,019,618 members

Comments by majune (Top 4 by date)

majune 10-Apr-12 10:46am View    
two way:
1.modify the setup project.
when you make the setup,you should specify the path of f.mdf,ensure that the file will install into AppData folder.
2.copy f.mdf to AppData folder by app.
every time you run you app,the first thing is to copy the file to AppData folder,
you can add the follow code in your Main(or init) method and try again:
-----------------------------------------------------------------------------------
string sourcePath=@"C:\PROGRAM FILES\DEFAULT COMPANY NAME\SETUPER2";
string appDataPath= Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string fileName="F.MDF";
System.IO.File.Copy(sourcePath+"\\"+fileName, appDataPath+"\\"+fileName ,false);
----------------------------------------------------------------------------------
*1 is better.
majune 10-Apr-12 10:45am View    
Deleted
two way:
1.modify the setup project.
when you make the setup,you should specify the path of f.mdf,ensure that the file will install into AppData folder.
2.copy f.mdf to AppData folder by app.
every time you run you app,the first thing is to copy the file to AppData folder,
you can add the follow code in your Main(or init) method and try again:
-----------------------------------------------------------------------------------
string sourcePath=@"C:\PROGRAM FILES\DEFAULT COMPANY NAME\SETUPER2";
string appDataPath= Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string fileName="F.MDF";
System.IO.File.Copy(sourcePath+"\\"+fileName, appDataPath+"\\"+fileName ,false);
----------------------------------------------------------------------------------
*1 is better.
majune 9-Apr-12 11:14am View    
It seems be a permission issue,do you have the permission to create/modify/delete a file in folder "C:\PROGRAM FILES\DEFAULT COMPANY NAME\SETUPER2"? you can try to create/modify/delete one file in the folder.
majune 8-Apr-12 7:53am View    
Use constraint to make T base on IComparable.
"where T:IComparable<t>"