2.0 : config GridView to use SPs ?

J

John A Grandy

It looks like MS wants you to use config a SQLDataSource , hand coding the
SELECT, INSERT, UPDATE, DELETE SQL , and then assigning
GridView.DataSourceID = SQLDataSource ...

But what if you prefer to encapsulate all your DML in SPs ? Is it possible
to config the SQLDataSource with SPs ? If not, is there an alternative to
MS's preferred method for config'ing a GridView ?
 
J

Jeff Lynch

I usually write a BLL which calls the sprocs from public methods and then
use the ObjectDataSource pointing to the BLL.
 
S

sloan

The BLL is the "BusinessLogicLayer".

You need to use:
ObjectDataSource

and then create something like a custom collection

MyEmpCollection : CollectionBase

Where.. you will put Emp objects inside of your MyEmpCollection

...


If you don't know how to create CollectionBase ('s), then check
http://spaces.msn.com/sholliday/ 9/21/2005 entry

You can ingore the XmlSerializer stuff, and just get the CollectionBase
stuff.
 
J

John A Grandy

Normally I'd do that ... because I'm a OO , multi-tier guy ...

..... but I'm just trying to test out this DataView control to see if it's
worth using. The provided wizards should work against simple table with
simple select,insert,update,delete sps .... shouldn't they ?

Or is this another "botched wizard" from MS ?
 
A

Angelo Cook

Its another botched component, I have been able to do just about everything
(edit, update and delete) but can not get the insert figured out.

I would like to use the footer to hold the input row, that part is easy, and
use an image button/link to implement the insert. well unless I create a an
onclick postback routine on the insert image, it does not work. When i am
able to get it to work the resulting refresh of data does not reflect the
newlly added row or the deleted row in the event of a delete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,131
Latest member
IsiahLiebe
Top