Solved

Visual Studio Database object

Posted on 2007-11-26
4
163 Views
Last Modified: 2010-04-23
I created a new project and I want it to be used only on a local machine. I need a database installed with the project so I added a database componet to the project.  (Project/Add Componet/Sql Database).  This is going to be a very simple database program so I don't need a lot of power.   Two questions:  1.  Did I do the right thing and 2. Where is a good reference to work with the componet.
I did a search in the help file and returned nothing of value.
0
Comment
Question by:Moed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
jcoehoorn earned 500 total points
ID: 20353890
1)  I think you need SQL Server to take proper advantage of the database component you added, but I could be wrong here.  Either way, since it's intended for local use only if you have SQL Express running on your machine you should be fine.  You can test it by going to the menu in Visual Studio and choosing View->Server Explorer.  Find your database component there (Database1.mdf is the default name), right click on it and choose 'Modify Connection'.  At the bottom of the window that opens is a button labeled 'Test Connection' that works like it's name implies.  If the test succeeds then you are fine.  

2)  To work with this component you can use the Server Explorer we just opened to add tables, columns, and the like to the database.  You can use the System.Data.SqlClient namespace to send SQL queries to the database or add new dataset components to create typed datasets for databinding with very little code.
0
 
LVL 2

Author Comment

by:Moed
ID: 20354253
I don't want to have sql server or express.  Isn't there a database object that can be added to have limited database functionality within the program?  
0
 
LVL 2

Author Comment

by:Moed
ID: 20354383
After doing a little more research I think what I want to do is privately deploy Sql CE.  Do you know of a resource that might help with that?
0
 
LVL 18

Expert Comment

by:jcoehoorn
ID: 20506957
Sql CE is a great choice.  It's not different to work with compared to regular SQL Server, so most of the examples or tutorials you find for creating SQL Server code will be very similar when applied to Sql CE.  There are two main things to keep in mind:
1) You use the system.data.sqlce namespace rather than system.data.sqlclient
2) You need to download and install the engine on your computer, and include the engine with your app's install package.  This isn't that difficult- just add the msi as a dependency and the setup project can take do it automatically.

Download the package here:
http://www.microsoft.com/sql/editions/compact/downloads.mspx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question