Link to home
Start Free TrialLog in
Avatar of JaneRogers
JaneRogers

asked on

Sample SQL database with VB.Net code ...?

I have recently installed visual studio 2005 and I will be using VB to access data in an SQL database.

My question is easy...

When I previously used MS Access there was a sample database called "Northwind" which was a good source of sample code.

Is there an equivalent type of sample database which I can download written for vb.net 2005 with a SQL Server database??

The items on the setup CD are of no use so far- I couldn't get them to work.

Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Hello JaneRogers,

it's the itworks db and the sample come with the sql server installation

you could also look for other samples like
http://www.microsoft.com/Downloads/details.aspx?familyid=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en
http://www.novicksoftware.com/Presentations/clr-programming-dotnet-sql-server-2005-yukon/clr-dotnet-sql-server-2005-yukon.htm

hope this helps a bit
bruintje
Avatar of JaneRogers
JaneRogers

ASKER


I tried the second link, downloaded the file and unzipped everything to a separate folder

When I try to execute the file SQLCLRSP1.vbproj  I get an error saying that it cannot locate a database linked to the project.  I'm still quite new at this and I'm not sure how to attatch the database file.
...another thing, I don't see any forms in the project- did I miss them??
ASKER CERTIFIED SOLUTION
Avatar of MacNuttin
MacNuttin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi MacNuttin,

I've already tried the link you suggested here's what happened ...

Downloaded the file 'AdventureWorksBI.msi'

Installed the package.

Went to the installation folder and double-clicked the file 'AdventureWorks.sln'

There was the following message:

The application for project 'C:\ ... \Adventrue Works DW Standard Edition.dwproj' is not installed.

Make sure the application for the project type (.dwproj) is installed.

Two questions...

1 - What is the next step to get this working??

2 - As I mentioned in the question, I need an example of accessing data in a SQL server database using vb.net- is this a vb.net project??

Keep your suggestions coming!




Did you install a SQL 2005 database? Desktop vesion is here:

http://msdn.microsoft.com/vstudio/express/sql/download/

SQL 2005 *is* installed

I'll re-install and try again.
Can you see the SQL2005 instance with ODBC or any tool that makes a connection to the SQL2005 instance?
I've been on holiday- sorry for not replying sooner!

In the Server Explorer I can connect to a SQL 2005 database, is that what you meant??
That's good but no, Do you know about control panel-->admistrative Tools-->data sources(ODBC) Do you know how to set and test a connection to your database?

You need to configure your VS project to connect with a connection string. There is a wizard for doing this and LOTS of instructions tutorials examples in the help of VS.

I'm guessing that Adventure Works didn't install because it was looking for the standard edition of SQL2005 not the express? In any case you can accomplish your goal of "I need an example of accessing data in a SQL server database using vb.net" by sending this query(SELECT Name FROM master..sysdatabases) in VS and returning the record set