PC Review


Reply
Thread Tools Rate Thread

about creating a database from Visual Studio

 
 
Tony
Guest
Posts: n/a
 
      25th Nov 2011
Hello!

I can create a database in solution explorer in the following way.
1. Right click the project choose add new item
2. Choose a SQL Server Database
3 You get a question if you want to add the database to App_Data

When you have done this the database will also appear in the Server Explorer
that exist in Visual Studio
with extension mdf
The created database does not exist within the list of available databases
in Sql server Management Studio

I can also create a database from server Explorer in the following.
1.Right click on the Data Connection and choose Create new SQL server
Database
2.A dialog (Create New SQL Server Database) appear.
3. Choose what server for example the default server instance or perhaps the
named express instance
4.Give the database a name.
5 Now the database appear in the Server explorer with extension dbo
The created database also appear within the list of available databases in
sql server Management

Now to my question what is the difference between these two ways to create a
database ?

I mean when I used the first way the SQL server must be used even though the
database didn't appear in the list of available databases in SQl Server
Management studio.

There are some obvious differences for example.
1. I can't access the database from within SQL Server because it does not
exist here
2. In both ways I can access the database from the Server explorer

//Tony



 
Reply With Quote
 
 
 
 
Tony
Guest
Posts: n/a
 
      25th Nov 2011

"Big Steel" <"The SteelAAA"@SteelAAA.com> skrev i meddelandet
news:F5-dnfyAnrTH-lLTnZ2dnUVZ_q-(E-Mail Removed)...
> On 11/25/2011 4:43 AM, Tony wrote:
>> Hello!
>>
>> I can create a database in solution explorer in the following way.
>> 1. Right click the project choose add new item
>> 2. Choose a SQL Server Database
>> 3 You get a question if you want to add the database to App_Data
>>
>> When you have done this the database will also appear in the Server
>> Explorer that exist in Visual Studio
>> with extension mdf
>> The created database does not exist within the list of available
>> databases
>> in Sql server Management Studio
>>
>> I can also create a database from server Explorer in the following.
>> 1.Right click on the Data Connection and choose Create new SQL server
>> Database
>> 2.A dialog (Create New SQL Server Database) appear.
>> 3. Choose what server for example the default server instance or perhaps
>> the
>> named express instance
>> 4.Give the database a name.
>> 5 Now the database appear in the Server explorer with extension dbo
>> The created database also appear within the list of available databases
>> in
>> sql server Management
>>
>> Now to my question what is the difference between these two ways to
>> create a
>> database ?
>>
>> I mean when I used the first way the SQL server must be used even though
>> the
>> database didn't appear in the list of available databases in SQl Server
>> Management studio.
>>
>> There are some obvious differences for example.
>> 1. I can't access the database from within SQL Server because it does not
>> exist here
>> 2. In both ways I can access the database from the Server explorer
>>

>
> I never use VS's SQL server functionality to create a database. I always
> use SQL Server's Management Studio or I use Toad.


This wasn't what I asked about !

//Tony

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      25th Nov 2011
On 11/25/2011 4:43 AM, Tony wrote:
> I can create a database in solution explorer in the following way.
> 1. Right click the project choose add new item
> 2. Choose a SQL Server Database
> 3 You get a question if you want to add the database to App_Data
>
> When you have done this the database will also appear in the Server
> Explorer that exist in Visual Studio
> with extension mdf
> The created database does not exist within the list of available databases
> in Sql server Management Studio
>
> I can also create a database from server Explorer in the following.
> 1.Right click on the Data Connection and choose Create new SQL server
> Database
> 2.A dialog (Create New SQL Server Database) appear.
> 3. Choose what server for example the default server instance or perhaps
> the
> named express instance
> 4.Give the database a name.
> 5 Now the database appear in the Server explorer with extension dbo
> The created database also appear within the list of available databases in
> sql server Management
>
> Now to my question what is the difference between these two ways to
> create a
> database ?
>
> I mean when I used the first way the SQL server must be used even though
> the
> database didn't appear in the list of available databases in SQl Server
> Management studio.
>
> There are some obvious differences for example.
> 1. I can't access the database from within SQL Server because it does not
> exist here
> 2. In both ways I can access the database from the Server explorer


I am not a SQLServer expert, but I guess that the difference is between
a so called "user instance" database and a normal SQLServer database.

(http://msdn.microsoft.com/en-us/library/bb264564.aspx explains
what a user instance is intended for)

Arne

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      25th Nov 2011
On 11/25/2011 7:47 AM, Tony wrote:
> "Big Steel" <"The SteelAAA"@SteelAAA.com> skrev i meddelandet
> news:F5-dnfyAnrTH-lLTnZ2dnUVZ_q-(E-Mail Removed)...
>> On 11/25/2011 4:43 AM, Tony wrote:
>>> Hello!
>>>
>>> I can create a database in solution explorer in the following way.
>>> 1. Right click the project choose add new item
>>> 2. Choose a SQL Server Database
>>> 3 You get a question if you want to add the database to App_Data
>>>
>>> When you have done this the database will also appear in the Server
>>> Explorer that exist in Visual Studio
>>> with extension mdf
>>> The created database does not exist within the list of available
>>> databases
>>> in Sql server Management Studio
>>>
>>> I can also create a database from server Explorer in the following.
>>> 1.Right click on the Data Connection and choose Create new SQL server
>>> Database
>>> 2.A dialog (Create New SQL Server Database) appear.
>>> 3. Choose what server for example the default server instance or perhaps
>>> the
>>> named express instance
>>> 4.Give the database a name.
>>> 5 Now the database appear in the Server explorer with extension dbo
>>> The created database also appear within the list of available
>>> databases in
>>> sql server Management
>>>
>>> Now to my question what is the difference between these two ways to
>>> create a
>>> database ?
>>>
>>> I mean when I used the first way the SQL server must be used even though
>>> the
>>> database didn't appear in the list of available databases in SQl Server
>>> Management studio.
>>>
>>> There are some obvious differences for example.
>>> 1. I can't access the database from within SQL Server because it does
>>> not
>>> exist here
>>> 2. In both ways I can access the database from the Server explorer
>>>

>>
>> I never use VS's SQL server functionality to create a database. I
>> always use SQL Server's Management Studio or I use Toad.

>
> This wasn't what I asked about !


True.

But I think it is good advice.

I would also always use SQLServer Studio (or similar tool) to create
databases - normal databases - no user instance for me.

Arne

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      25th Nov 2011
On 11/25/2011 5:03 PM, Big Steel wrote:
> On 11/25/2011 4:53 PM, Arne Vajhøj wrote:
>> On 11/25/2011 7:47 AM, Tony wrote:
>>> "Big Steel" <"The SteelAAA"@SteelAAA.com> skrev i meddelandet
>>> news:F5-dnfyAnrTH-lLTnZ2dnUVZ_q-(E-Mail Removed)...
>>>> On 11/25/2011 4:43 AM, Tony wrote:
>>>>> Hello!
>>>>>
>>>>> I can create a database in solution explorer in the following way.
>>>>> 1. Right click the project choose add new item
>>>>> 2. Choose a SQL Server Database
>>>>> 3 You get a question if you want to add the database to App_Data
>>>>>
>>>>> When you have done this the database will also appear in the Server
>>>>> Explorer that exist in Visual Studio
>>>>> with extension mdf
>>>>> The created database does not exist within the list of available
>>>>> databases
>>>>> in Sql server Management Studio
>>>>>
>>>>> I can also create a database from server Explorer in the following.
>>>>> 1.Right click on the Data Connection and choose Create new SQL server
>>>>> Database
>>>>> 2.A dialog (Create New SQL Server Database) appear.
>>>>> 3. Choose what server for example the default server instance or
>>>>> perhaps
>>>>> the
>>>>> named express instance
>>>>> 4.Give the database a name.
>>>>> 5 Now the database appear in the Server explorer with extension dbo
>>>>> The created database also appear within the list of available
>>>>> databases in
>>>>> sql server Management
>>>>>
>>>>> Now to my question what is the difference between these two ways to
>>>>> create a
>>>>> database ?
>>>>>
>>>>> I mean when I used the first way the SQL server must be used even
>>>>> though
>>>>> the
>>>>> database didn't appear in the list of available databases in SQl
>>>>> Server
>>>>> Management studio.
>>>>>
>>>>> There are some obvious differences for example.
>>>>> 1. I can't access the database from within SQL Server because it does
>>>>> not
>>>>> exist here
>>>>> 2. In both ways I can access the database from the Server explorer
>>>>>
>>>>
>>>> I never use VS's SQL server functionality to create a database. I
>>>> always use SQL Server's Management Studio or I use Toad.
>>>
>>> This wasn't what I asked about !

>>
>> True.
>>
>> But I think it is good advice.
>>
>> I would also always use SQLServer Studio (or similar tool) to create
>> databases - normal databases - no user instance for me.
>>

>
> If I did use VS to create a SQL server database, I would just move the
> MDB file to the SQL Server Data directory and do an Attach.
>
> If using SQL Express and deploying mdb with a solution to a client as an
> example, that's a different thing.


It is different.

But I would either:
- use SQLServer
- provide SQL setup scripts
- let the clients DBA create the database
or:
- use an embedded database
- let the app do everything

Arne


 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      26th Nov 2011
On 11/25/2011 5:23 PM, Big Steel wrote:
> On 11/25/2011 5:13 PM, Arne Vajhøj wrote:
>> On 11/25/2011 5:03 PM, Big Steel wrote:
>>> On 11/25/2011 4:53 PM, Arne Vajhøj wrote:
>>>> On 11/25/2011 7:47 AM, Tony wrote:
>>>>> "Big Steel" <"The SteelAAA"@SteelAAA.com> skrev i meddelandet
>>>>> news:F5-dnfyAnrTH-lLTnZ2dnUVZ_q-(E-Mail Removed)...
>>>>>> On 11/25/2011 4:43 AM, Tony wrote:
>>>>>>> Hello!
>>>>>>>
>>>>>>> I can create a database in solution explorer in the following way.
>>>>>>> 1. Right click the project choose add new item
>>>>>>> 2. Choose a SQL Server Database
>>>>>>> 3 You get a question if you want to add the database to App_Data
>>>>>>>
>>>>>>> When you have done this the database will also appear in the Server
>>>>>>> Explorer that exist in Visual Studio
>>>>>>> with extension mdf
>>>>>>> The created database does not exist within the list of available
>>>>>>> databases
>>>>>>> in Sql server Management Studio
>>>>>>>
>>>>>>> I can also create a database from server Explorer in the following.
>>>>>>> 1.Right click on the Data Connection and choose Create new SQL
>>>>>>> server
>>>>>>> Database
>>>>>>> 2.A dialog (Create New SQL Server Database) appear.
>>>>>>> 3. Choose what server for example the default server instance or
>>>>>>> perhaps
>>>>>>> the
>>>>>>> named express instance
>>>>>>> 4.Give the database a name.
>>>>>>> 5 Now the database appear in the Server explorer with extension dbo
>>>>>>> The created database also appear within the list of available
>>>>>>> databases in
>>>>>>> sql server Management
>>>>>>>
>>>>>>> Now to my question what is the difference between these two ways to
>>>>>>> create a
>>>>>>> database ?
>>>>>>>
>>>>>>> I mean when I used the first way the SQL server must be used even
>>>>>>> though
>>>>>>> the
>>>>>>> database didn't appear in the list of available databases in SQl
>>>>>>> Server
>>>>>>> Management studio.
>>>>>>>
>>>>>>> There are some obvious differences for example.
>>>>>>> 1. I can't access the database from within SQL Server because it
>>>>>>> does
>>>>>>> not
>>>>>>> exist here
>>>>>>> 2. In both ways I can access the database from the Server explorer
>>>>>>>
>>>>>>
>>>>>> I never use VS's SQL server functionality to create a database. I
>>>>>> always use SQL Server's Management Studio or I use Toad.
>>>>>
>>>>> This wasn't what I asked about !
>>>>
>>>> True.
>>>>
>>>> But I think it is good advice.
>>>>
>>>> I would also always use SQLServer Studio (or similar tool) to create
>>>> databases - normal databases - no user instance for me.
>>>>
>>>
>>> If I did use VS to create a SQL server database, I would just move the
>>> MDB file to the SQL Server Data directory and do an Attach.
>>>
>>> If using SQL Express and deploying mdb with a solution to a client as an
>>> example, that's a different thing.

>>
>> It is different.
>>
>> But I would either:
>> - use SQLServer
>> - provide SQL setup scripts
>> - let the clients DBA create the database
>> or:
>> - use an embedded database
>> - let the app do everything

>
> When I am talking client, I mean some mom and pop client that doesn't
> have a DBA, kind of like deploying an Access database.


I would use Access or SQLServer CE or SQLite or something similar for
that context.

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:37 PM.