i am trying to implement a website in asp.net (i am a already a bit experienced) and want it to be secure. It doesn't need to withstand a big hackerattack :) I just want to avoid basic "noob-mistakes".
1) For authentification i want to use the forms-authentification with roles etc. (and all corresponding controls of .net)
2) My database needs to be accesed from the website (on the same webserver where the mssql server express is installed) AND in need to access the database from a WinFrom-C#-Application from a few clients.
3) the mdf-file should not be viewed/downloaded/hacked (avoiding "noob-mistakes").
now my problem:
I didn't understand where the best location for the mdf-files for the sql-server express is. There is the App-Data folder for the Website and the default location under C://program files/.../sqlserver/.../DATA.
Does someone has already experience and can help me to find the best location for the database file so that 1), 2) and 3) are working
Yes, the point is that SQL Server doesn't connect to a file but to a db engine. The file itself doesn't have to be reachable by applications. For SQL Server it should be YourServer\SQLEXPRESS. If the app is not on the same machine you have to enable remote
access: try http://datamasker.com/SSE2005_NetworkCfg.htm
Files stored in App_Data are blocked from being downloaded. It can be convenient if you really want to attach dynamically a database file to a particular SQL Server instance but it's likely best to always connect to a known configured db already configured
in a particular instance if you can.
None
0 Points
4 Posts
Where put the mssql server file for asp.net website?
Jan 12, 2016 09:55 PM|asp.net_fan|LINK
Hi everybody,
i am trying to implement a website in asp.net (i am a already a bit experienced) and want it to be secure. It doesn't need to withstand a big hackerattack :) I just want to avoid basic "noob-mistakes".
1) For authentification i want to use the forms-authentification with roles etc. (and all corresponding controls of .net)
2) My database needs to be accesed from the website (on the same webserver where the mssql server express is installed) AND in need to access the database from a WinFrom-C#-Application from a few clients.
3) the mdf-file should not be viewed/downloaded/hacked (avoiding "noob-mistakes").
now my problem:
I didn't understand where the best location for the mdf-files for the sql-server express is. There is the App-Data folder for the Website and the default location under C://program files/.../sqlserver/.../DATA.
Does someone has already experience and can help me to find the best location for the database file so that 1), 2) and 3) are working
Thansks!
All-Star
51271 Points
15123 Posts
Re: Where put the mssql server file for asp.net website?
Jan 13, 2016 01:53 AM|oned_gk|LINK
AFAIK, you can connect to sql express db local only
You can't connect it from another PC
To connect db from few clients you need SQL Server database (not express version) installed in server
Suwandi - Non Graduate Programmer
Contributor
6353 Points
5568 Posts
Re: Where put the mssql server file for asp.net website?
Jan 13, 2016 04:42 AM|wmec|LINK
Try to put this
within Web.config/app.config file in your project, to ensure the project will work fine with the database.
HuaMin Chen
None
0 Points
4 Posts
Re: Where put the mssql server file for asp.net website?
Jan 13, 2016 11:40 AM|asp.net_fan|LINK
hi wmec,
thanks for the reply, Does this work with sql server express?
- connecting the database from the website
- and from a c# application
All-Star
40100 Points
12960 Posts
Re: Where put the mssql server file for asp.net website?
Jan 13, 2016 12:21 PM|PatriceSc|LINK
Hi,
Yes, the point is that SQL Server doesn't connect to a file but to a db engine. The file itself doesn't have to be reachable by applications. For SQL Server it should be YourServer\SQLEXPRESS. If the app is not on the same machine you have to enable remote access: try http://datamasker.com/SSE2005_NetworkCfg.htm
Files stored in App_Data are blocked from being downloaded. It can be convenient if you really want to attach dynamically a database file to a particular SQL Server instance but it's likely best to always connect to a known configured db already configured in a particular instance if you can.
None
0 Points
4 Posts
Re: Where put the mssql server file for asp.net website?
Jan 13, 2016 06:34 PM|asp.net_fan|LINK
Hi Patrice,
thanks for your help. Im going to put the database-file in the App-Data folder and try to connect it (additionaliy to the website) with a C# app.
thanks a lot.