Problem with creating a new database
When I try to create a new database with asp.net sql server setup wizard it connects to my local server and creates a database with all the tables from all the databases that exist in the local machine. But I want a new aspnetdb database with em开发者_如何学Cpty tables for profiling.
UPDATE :
aspnet_regsql.exe -C<Data Source=.\SQLEXPRESS;AttachDbFilename="D:\Documents and Settings\Dima\My Documents\Visual Studio 2010\WebSites\Profiling\App_Data\Membership.mdf";Integrated Security=True;User Instance=True> -S<DIMA-00AA1DA557>
I have no userid and password..sorry it tells me ..syntax is wrong
It sounds like you just want the tables, but no data, for aspnetdb. Run the following command in a command (DOS) window:
aspnet_regsql.exe
For example:
aspnet_regsql.exe -C<connectionstring> -S<servername> -U<userid> -P<password>
Where <connectionstring>
, <servername>
, <userid>
and <password>
are filled in by you with your specific information. Remove the <
and >
from the parameters I listed to fix your incorrect syntax error.
ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe) has all the details.
UPDATE
If you can log in to the server (with your Windows credentials), try this with the -E switch. I'm not sure you can attach a database with this, but it can't hurt to try.
apsnet_regsql.exe -CData Source=.\SQLEXPRESS;AttachDbFilename="D:\Documents and Settings\Dima\My Documents\Visual Studio 2010\WebSites\Profiling\App_Data\Membership.mdf";Integrated Security=True;User Instance=True -SDIMA-00AA1DA557 -E
UPDATE 2
According to the documentation linked above, the -C option is not required if you specify -U and -P or -E. So, assuming your windows credentials allow you access to the SDIMA-00AA1DA557 server, try this:
aspnet_regsql.exe -E -SDIMA-00AA1DA557
I agreed with Tim, you need to use command-line registration tool. Additionaly (to make sure) check 'model' database on your local SQL server. Each new databse by default contains all objects from 'model' database.
精彩评论