I commiserate. There are a number of places in Visual Studio that make it hard to understand how to connect to SQL Server. To address these issues, I wrote a long chapter in my book that focuses on connecting. I also give a long session on connecting in my workshops (the next is at DevWeek in Toronto). I would give you a two-paragraph answer here but the issue is more complex than that. Generally:
a.. I don't endorse including the database in the project or using the User Instance=True option.
b.. I do endorse setting up a local instance of SQL Express (this is done for you when you install VS) and attaching the database to that instance while building the database and the application(s) that access it.
c.. I endorse building a setup script that deploys SQL Express and attaches the database at install time along with proper user configuration.
hth

Signature
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
Thanks Bill for the response. Does your book provide examples of building setup scripts?
Peter
I commiserate. There are a number of places in Visual Studio that make it hard to understand how to connect to SQL Server. To address these issues, I wrote a long chapter in my book that focuses on connecting. I also give a long session on connecting in my workshops (the next is at DevWeek in Toronto). I would give you a two-paragraph answer here but the issue is more complex than that. Generally:
a.. I don't endorse including the database in the project or using the User Instance=True option.
b.. I do endorse setting up a local instance of SQL Express (this is done for you when you install VS) and attaching the database to that instance while building the database and the application(s) that access it.
c.. I endorse building a setup script that deploys SQL Express and attaches the database at install time along with proper user configuration.
hth
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
<peter.taslimi@hotmail.com> wrote in message news:4067A104-8606-4E63-AAC6-D89B6896851E@microsoft.com...
>I am a beginner and having difficulty understanding some database connection
> related issues. I started off with VB Express 2005/2008 and have moved to VB
> 2008 Professional (The trial edition currently).
>
> 1. In VB Express when connecting to a database I was given a choice as to
> whether I wanted a copy in my local project directory. It seems that in VB
> 2008 one is not given a dialog to choose and instead one has to select
> whether connecting to a database or attaching a database. Is this correct?
>
> 2. If 1) above is true, then there are two choices. Connect directly to the
> database or attach to the database which creates a local connection under
> the project directory.
>
> 3. If one connects directly to the database and enters sample data, then the
> id counter can only be reset with an sql query statement or by deleting the
> id field and re-entering it. I am not sure whether the dataset gets updated
> at this point? or whether one has to delete the dataset and create it again
> using the wizard?
>
> 4. If one attaches to the local project directory database and any changes
> are required to the column structures, then this is the process I have gone
> through :
> Fix the field in SSME.
> Detach the database, so that it can be copied to the project directory.
> (Otherwise one is allowed to copy).
> Copy the database to the project directory.
> Recreate the dataset
> build the project again
> Run debug to see if it works.
>
> I am sure there must be an easier way to deal with this and probably because
> I just don't get the whole concept. Any explanations or related links would
> be much appreciated..
>
> Peter
>
>
William Vaughn - 26 Feb 2008 17:45 GMT
Nope, sorry. They told me to stop writing as I approached 800 pages... ;)

Signature
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
Thanks Bill for the response. Does your book provide examples of building setup scripts?
Peter
"William Vaughn" <billvaNoSPAM@betav.com> wrote in message news:A193A0A9-32BF-44C7-B13D-0CEC018BF0DC@microsoft.com...
I commiserate. There are a number of places in Visual Studio that make it hard to understand how to connect to SQL Server. To address these issues, I wrote a long chapter in my book that focuses on connecting. I also give a long session on connecting in my workshops (the next is at DevWeek in Toronto). I would give you a two-paragraph answer here but the issue is more complex than that. Generally:
a.. I don't endorse including the database in the project or using the User Instance=True option.
b.. I do endorse setting up a local instance of SQL Express (this is done for you when you install VS) and attaching the database to that instance while building the database and the application(s) that access it.
c.. I endorse building a setup script that deploys SQL Express and attaches the database at install time along with proper user configuration.
hth
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
<peter.taslimi@hotmail.com> wrote in message news:4067A104-8606-4E63-AAC6-D89B6896851E@microsoft.com...
>I am a beginner and having difficulty understanding some database connection
> related issues. I started off with VB Express 2005/2008 and have moved to VB
> 2008 Professional (The trial edition currently).
>
> 1. In VB Express when connecting to a database I was given a choice as to
> whether I wanted a copy in my local project directory. It seems that in VB
> 2008 one is not given a dialog to choose and instead one has to select
> whether connecting to a database or attaching a database. Is this correct?
>
> 2. If 1) above is true, then there are two choices. Connect directly to the
> database or attach to the database which creates a local connection under
> the project directory.
>
> 3. If one connects directly to the database and enters sample data, then the
> id counter can only be reset with an sql query statement or by deleting the
> id field and re-entering it. I am not sure whether the dataset gets updated
> at this point? or whether one has to delete the dataset and create it again
> using the wizard?
>
> 4. If one attaches to the local project directory database and any changes
> are required to the column structures, then this is the process I have gone
> through :
> Fix the field in SSME.
> Detach the database, so that it can be copied to the project directory.
> (Otherwise one is allowed to copy).
> Copy the database to the project directory.
> Recreate the dataset
> build the project again
> Run debug to see if it works.
>
> I am sure there must be an easier way to deal with this and probably because
> I just don't get the whole concept. Any explanations or related links would
> be much appreciated..
>
> Peter
>
>