all groups > dotnet datatools > july 2004 >
You're in the

dotnet datatools

group:

datagrid control & stored procedures - how to use together


datagrid control & stored procedures - how to use together steve
7/27/2004 9:29:31 AM
dotnet datatools:
I'm trying to write a small app using vb.net going to SQL Server 2k, and
using:

Imports System.Data.SqlClient

Imports System.Data.SqlTypes.

I'm using all stored procedures, necessarily, and am having quite a bit of
trouble interogating, updating, and generally manipulating the datagrid
control.

The control apparently presumes access directly to tables, which is
unacceptable in my environment. I've yet to see any examples of using stored
procedures to fill the datagrid control, and stored procs to interface with
the control and update the db.

I realize this isn't keeping with the way Microsoft designed the control,
but my environment requires -all- access to the db to be abstracted through
stored procedures.

Can anyone point me to some decent code examples - using a grid control in
vb.net - and using stored procs /TDS to select from and update the db ?

Thanks -


Re: datagrid control & stored procedures - how to use together John Saunders
7/28/2004 8:18:25 AM
[quoted text, click to view]

Steve,

You should take a look at the use of DataSets in ADO.NET. With a DataSet,
one usually uses one DataAdapter to fill the DataSet, plus one each for
Inserts, Updates and Deletes. Each of the DataAdapters can reference a
stored procedure. Take a look at: Walkthrough: Simple Data Access in a
Windows Form
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html
/vbwlkwalkthroughdisplayingdatafromsingletableinwindowsform.asp).
--
John Saunders
johnwsaundersiii at hotmail

AddThis Social Bookmark Button