Solved

Good efficient practice with accessing a database developing a web application

Posted on 2006-11-12
2
144 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change data in datatable 8 31
How to Get total minutes between two hours 4 45
vb.net 2 37
Allow User To Arrange Columns At Datagridview 3 19
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

19 Experts available now in Live!

Get 1:1 Help Now