Home All Groups Group Topic Archive Search About

Update Database records ??

Author
30 Mar 2006 11:26 AM
serge calderara
Dear all,

I have a dataset object which as been filled from an SQL server table
I have then a dataview from that dataset,which is bind to a datagrid object.

My user can edit, update, delete entry directly from that datagrid through
an ASP page.

Is there a simple way to automatically handle a database object based on the
rowstate of the datagid ?

What I mean is that :
- if my user add an entry I should run a proper INSERT querry
- if my user Update an entry I should run a proper UPDATE querry
- if my user add an entry I should run a proper DELETE querry

Is there any self intelligent function which is able to read the status of
Rows and execute proper statement.

I could also use the GetChange function to build a new dataset and then
handle th select ..


Any tips

thnaks for your help
regards
serge

Author
30 Mar 2006 4:28 PM
Cowboy (Gregory A. Beamer) - MVP
Unless you are not using binding at all (or have customized ASP.NET to look
just like ASP - a chore so many go through that makes life SO much harder),
when a person edits a row, you get a button to fire an event.

It is not automagic and you have to link the data back, but a DataAdapter
with proper SELECT, INSERT, UPDATE and DELETE commands can handle all of the
CRUD for you without much pain. Most of the work necessary is simple drag and
drop.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


Show quote
"serge calderara" wrote:

> Dear all,
>
> I have a dataset object which as been filled from an SQL server table
> I have then a dataview from that dataset,which is bind to a datagrid object.
>
> My user can edit, update, delete entry directly from that datagrid through
> an ASP page.
>
> Is there a simple way to automatically handle a database object based on the
> rowstate of the datagid ?
>
> What I mean is that :
>  - if my user add an entry I should run a proper INSERT querry
>  - if my user Update an entry I should run a proper UPDATE querry
>  - if my user add an entry I should run a proper DELETE querry
>
> Is there any self intelligent function which is able to read the status of
> Rows and execute proper statement.
>
> I could also use the GetChange function to build a new dataset and then
> handle th select ..
>
>
> Any tips
>
> thnaks for your help
> regards
> serge

AddThis Social Bookmark Button