views:

41

answers:

1

Hello,

The way I understood it, a project being developed in VWD 2008 Express, unlike in the VS2008, can only access one DB. So, I guess I need absolutely to locate all my tables in a unique DB. By tables, I mean: tables I create for my application as well as the default ones created by the framework (ASPNETDB).

Here's my connection string (Do I need to modify it????)

<connectionStrings>
<add name="MyWebsiteConnectionString" 
     connectionString="data source=.\SQLEXPRESS;
     Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;
     User Instance=true" 
     providerName="System.Data.SqlClient"
     /></connectionStrings>
  • Should I, after I've created ASPNETDB, merely add my tables in it?
  • Should I, first create a DB, then add default tables in it??? (how?)

    To make it simple for now, I would like that DB to be created under the App_Data folder.

Thank you

+1  A: 

a project being developed in VWD 2008 Express ... can only access one DB

This is not true. You may only be able to use a visual wizard for one db (I don't know), but you can certainly connect to as many databases as you need to in your code. After deployment, an asp.net site doesn't even know if you used visual studio at all (it's certainly possible to build a site using notepad, for example) let alone what edition of visual studio you used.

Secondly, the "default [tables] created by the framework" can be created in any database you want using a command line tool that comes with Visual Studio. Just look for the Aspnet_regsql.exe program.

Joel Coehoorn
OMG Ponies
I feel already better. Also, can u tell me where to find it (Aspnet_regsql.exe) and how to use it so that it point to my DB under the App_Data? (sorry for 2 many questions)
Richard77
I forgot one thing. What happens to the above connection string? Do I keep as it is or modify it???Thanks
Richard77
I don't have the location handy. Use the Visual Studio command prompt and it should be in the path, or use windows search to find it.
Joel Coehoorn
As for how to use it, check it's command line options the same way as any other windows command line program (via the `/?` switch).
Joel Coehoorn
All the ressources in the net talk only about the Command Line in VS2008 standard Edition. I didn't install VS2008, but rather the VWD 2008 Express. Also, I've never used 'command line' before. So, can u tell me how to access 'Command line" in VWD Express ... or point me to some ressources that talk ebout it. Thanks
Richard77
The program should still be included with VWD Express. I would normally tell you to use the visual studio command prompt to access it, but I'm not sure whether or not that feature is excluded from VWD Express. To stat a normal command prompt, in windows XP just go to your start menu, choose `Run`, and type "`cmd`" into the window that opens.
Joel Coehoorn
In fact, I've tried the aspnet_regsql.exe wizard. It's straightforward tool. Unfortunately, it allowed me only to create my default security table in the SQL Server. What I want is to create those tables under the App_Data
Richard77
Your connection refers to an .mdf file. _That is sql server,_ even if the storage file is located in your app_data folder. You won't be able to use that file without a sql server engine running that you can attach it to. asp.net just hides the attachment part from you.
Joel Coehoorn
Thanks Joel, I see now clearly the difference. Concerning, the aspnet_regsql things, do you know if there's a 'Command Line' that comes with the VWD 2008 Express??? so that I can merge those tables???
Richard77
I don't know, but the only special thing about the visual studio command line is what's used in the PATH string. Just use windows search to find it. If you don't know how to use a command prompt it's well past time to learn, but that's a completely different topic.
Joel Coehoorn