when my ASP.NET 2.0 web site working against MS SQL Server 2000,
I Usually have a connection string to the DB, I create a connection, and start working on the data.
While reading about the MemberShip provider of ASP.NET 2.0 (Login control, Forgot password, etc.),
I read that it's possible to save the MDF file of the membership controls, within the APP_DATA folder.
But how can it be ? the MDF file must be at the server folder,
How can I access this MDF file ? with which connection string ?
How does MS SQL Server 2000 syncronize against this MDF file within my APP_DATA folder ?
And by the way, if my hosting company allow me to use 1 db schema of the MS SQL Server 2000 server,
Does this method (saving the MDF file within thr APP_DATA folder) allow me to use multiple schemas ?
Thanks.
Hi,
But how can it be ? the MDF file must be at the server folder
For your first question, the built-in database is a new feature in .NET 2.0 which needs SQLExpress to support. The database is together with your application, you don't need to deploy the database additionally. The MDF file is stored in a folder called APP_DATA. When you application runs, the files in APP_DATA will be shipped as a database with your application automatically.
How can I access this MDF file ? with which connection string ?
If you want to access the database in SQLExpress, you also need connection string to achieve that. By default, the connection string for SQLExpress (built-in database) is located in Machine.Config, the name of the connection string is "LocalSqlServer", and you also can overwrite it and declare it at web.config file, even change the name of the connection string. But what you should note is, don't forget to modify the connection string attribute of the provider so that all the features supported by provider mechanism (i.e. Membership,Profile and etc) can work.
How does MS SQL Server 2000 syncronize against this MDF file within my APP_DATA folder
When you have decided to use SQLExpress to support your provider mechanism application, you don't need to use SQLServer2000. But if you want those provider supported application to work with SQLServer2000. You should use aspnet_regsql tool to transport the ASPNETDB to SQLServer2000 database, and modify the connection string attribute of corresponding provider.
For aspnet_regsql.exe tool, see:http://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx
For more information about ASP.NET provider, see:
http://msdn2.microsoft.com/en-us/library/aa478948.aspx
Thanks.
Thanks,
At my development machine :
But I removed SQL Server express from my machine, that means I can't just add the login control, than the MDF file will be created at the APP_DATA,
And everything will be ok ? I must install MS SQL Server express ?
At the hosting server :
There is ms sql server 2000, just copying the MDF data to the AAP_DATA, I guess will not work, right ?
I will need to mograte this MDF file, from my APP_DATA folder, to the real DB, right?
Hi,
But I removed SQL Server express from my machine, that means I can't just add the login control, than the MDF file will be created at the APP_DATA,
And everything will be ok ? I must install MS SQL Server express ?
When you remove your SQLExpress edtion, you still can use such features like membership. (Login controls,CreateUserWizard controls and etc.) But you should export the ASPNETDB in SQLExpress to SQLServer Database before you removing your SQLExpress, and change the membership provider.
There is ms sql server 2000, just copying the MDF data to the AAP_DATA, I guess will not work, right ?
It will not work. To use the database in APP_DATA, you must have SQLExpress installed on your server.
I will need to mograte this MDF file, from my APP_DATA folder, to the real DB, right
Right, you need to export the ASPNETDB.mdf to your SQLServer 2000 database.
Thanks.
|||Thanks
No comments:
Post a Comment