Solved

Good efficient practice with accessing a database developing a web application

Posted on 2006-11-12
2
172 Views
Last Modified: 2010-04-24
Hi
I am in the process of teaching myself VB.NET 2005. I have been a developer for over 20 years and I know there are many ways of doing things. So I would rather learn the most efficient way of accessing a database up front if possible.
1. Let me start from scratch. Lets say I am developing a web application, how and what do I need to do to access a MSSQL database?
2. How should I define a new DataSet and how would I make reference to the new dataset in my code?
3. If somebody has a very simple example of the way I should do my database access, it would be great.

I look forward to some helpfull answers.

Regards
kezit
0
Comment
Question by:kezit
[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 Comments
 
LVL 13

Accepted Solution

by:
newyuppie earned 500 total points
ID: 17924904
1. if you installed vb2005 i believe you already have all the drivers needed to access MSSQL databases. all the controls you need are in system.data.sqlclient

2. there are basically 2 options: typed datasets, or non typed datasets. the first ones are automatically generated by VB2005 when you use menu Data/Add New Data Source. the advantage of typed datasets is that a class gets automatically generated that exposes methods to directly access all the columns in your datatables by direct reference to the object. the most important generated object here would be the TableAdapter class.
the non typed datasets are when you create by code your connection, dataset, datatable, etc. only difference with typed datasets is that you will be using the DataAdapter class and not the TableAdapter.
i suggest you start with typed-datasets, and as you master it over time, maybe you could get more customization with the DataAdapter if you know what you are doing.
0
 

Author Comment

by:kezit
ID: 17925003
Ok, to create a typed dataset with a windows application it is no problem but if it is a Web application the data menu does not exist. How do i create a typed dataset for a web application?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 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