20 Jul 2010, 19:34
Generic-user-small

David Jenkins (23 posts)

(Re: paper page 89, “rename the database file from aspnetdb.mdf to GetOrganized.mdf.”)

After verifying that SQL Server Express was installed and running on my machine, I did a windows explorer search for aspnetdb.mdf, but couldn’t find it. Any assistance would be appreciated.

20 Jul 2010, 20:13
Headshot_pragsmall

Jonathan McCracken (35 posts)

David,

If the database doesn’t exist (not sure exactly why the mdf file isn’t there) - you can generate it by using the aspnet_regsql command.

If you run it without any of the options described on page 103 (eBook - sorry I don’t have the printed copy with me) it will generate a database via a wizard.

Let me know if that helps,

Jonathan

20 Jul 2010, 21:06
Headshot_pragsmall

Jonathan McCracken (35 posts)

A little more info from http://www.asp.net/security/tutorials/creating-the-membership-schema-in-sql-server-cs

aspnetdb.mdf should be created by the .NET runtime if it doesn’t exist yet for the web application in the /App_Data/ folder.

That’s why I’m a little surprised that it’s not there. Something fishy going on there. Let me know if either of these solutions work.

Jonathan

20 Jul 2010, 21:21
Generic-user-small

David Jenkins (23 posts)

(Hi, Jonathan, I posted the following before I saw your replies. I got past the aspnet_regsql hurdle, with the following)

not finding the aspnetdb.mdf, I went ahead and created GetOrganized according to the instructions on (paper) page 89. However, when I tried the aspnet_regsql command as instructed on page 91, I kept getting

` An error has occurred. Details of the exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Unable to connect to SQL Server database. `

After doing a bit of research, I found I had to add -S .\SQLEXPRESS to the command, so the full working command looked like

C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql -S .\SQLEXPRESS -A m r -d GetOrganized -E

20 Jul 2010, 21:25
Generic-user-small

David Jenkins (23 posts)

Jonathan, just FYI, even after I created the db, there’s still nothing in my /App_Data/ folder. It put it in @C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA@ I'm getting the feeling either 2010 or SQLEXPRESS behave differently than expected.

04 Mar 2011, 13:11
Generic-user-small

Robert Stackhouse (12 posts)

I must have glazed over the part where the text instructs you to rename the MDF file to “GetOrganized.mdf” (on page 89 of the paper book).

The statement, “It’s important to cover the next steps even if you have only the Express edition, because most production environments are going to use the Enterprise version of SQL Server…” sounds to me like: if I know SQL Server, I can skip this bit. In fact, I am much more familiar with the Enterprise version than the Express version. It is after that line that the “Initial Catalog” bit is specified. It might be useful to include a connection string for both versions of SQL Server.

I am curious as to why the DB file was renamed and the “Initial Catalog” parameter of the query string were required.

19 Feb 2012, 11:44
Generic-user-small

Anthony Candaele (1 post)

@ David Jenkins: Thanks David, I was having the same problem with aspnet_regsql command. Your research solved my problem. Thanks!

  You must be logged in to comment