Solved

Good efficient practice with accessing a database developing a web application

Posted on 2006-11-12
2
130 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
2 Comments
 
LVL 13

Accepted Solution

by:
newyuppie earned 500 total points
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now