469,909 Members | 1,617 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

how to fetch only newly added/edited record

We are using .net Framework 1.1

We are having one page on which we are using this Grid component.

From this page we open a popup for adding new record as well as for editing
an existing record (For Edit we want to pass the ID of that particular row)

And when user clicks on 'SAVE' button in popup window, those changes need to
be reflected onto the parent (into the Grid). This happens by refreshing the
parent page. But in that case all the records in grid are fetched from back
end. Instead, at server side we want only the newly added/updated record to
be fetched from the database.

AJAX or non-ajax, any way is ok. Any guidance on how to achieve this?

Thanking you in advance.

--
Regards,
Pravin

Mar 29 '07 #1
9 2291
Hi Pravin,

From your description, you have an ASP.NET 1.1 page that display some
database record through DataGrid control, and you'll use a popup page to
add new record or editing existing record. Currently, you're wondering how
to make the added or changed record info passed to the parent page so as to
update the DataGrid, correct?

According to this issue, here are some of my understanding:

First, when adding new row or editing exist row, if you want to get the
updated/inserted new values, you should get the primarykey identity of the
certain record so that you can perform query to get the updated value
later. For editing row, this should not be a problem. For new inserted
record, the DBMS engine should provide statement for retrieving new
inserted record's identity(such as the @@Identity of SQL Server) or you can
manually control the PK of table record.

Here is a former thread discussing on retrieve new inserted
value(sqlserver)'s auto generated identity:

#Retrieving Identity Values after DetailsView Insert More options
http://groups.google.com/group/micro...rk.aspnet/brow
se_thread/thread/8a228fb82461ec04/60bc5c390c0542b2

Second, after you get the updated value, how would you like to update the
main DataGrid's displayed data? ASP.NET template databound controls
populate data(rows) through databinding. Therefore, if you want to update
DataGrid's UI, the expected ways is to redo the databinding on DataGrid to
the new datasource. Do you think this is what you want?

In addition, for AJAX, so far ASP.NET 1.1 hasn't provide sufficient
built-in support on it. Do you think postback the page to updating the
DataGrid is acceptable?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 30 '07 #2
Hi I am having same query as that of Pravin

But after fetching only the newly added/edited row and updating the dataset
but again if we rebind the dataset it takes considerable time to display
whole data again. So is there any way to avoid this time or rebinding of
dataset to grid and still reflect the changes?

"Steven Cheng[MSFT]" wrote:
Hi Pravin,

From your description, you have an ASP.NET 1.1 page that display some
database record through DataGrid control, and you'll use a popup page to
add new record or editing existing record. Currently, you're wondering how
to make the added or changed record info passed to the parent page so as to
update the DataGrid, correct?

According to this issue, here are some of my understanding:

First, when adding new row or editing exist row, if you want to get the
updated/inserted new values, you should get the primarykey identity of the
certain record so that you can perform query to get the updated value
later. For editing row, this should not be a problem. For new inserted
record, the DBMS engine should provide statement for retrieving new
inserted record's identity(such as the @@Identity of SQL Server) or you can
manually control the PK of table record.

Here is a former thread discussing on retrieve new inserted
value(sqlserver)'s auto generated identity:

#Retrieving Identity Values after DetailsView Insert More options
http://groups.google.com/group/micro...rk.aspnet/brow
se_thread/thread/8a228fb82461ec04/60bc5c390c0542b2

Second, after you get the updated value, how would you like to update the
main DataGrid's displayed data? ASP.NET template databound controls
populate data(rows) through databinding. Therefore, if you want to update
DataGrid's UI, the expected ways is to redo the databinding on DataGrid to
the new datasource. Do you think this is what you want?

In addition, for AJAX, so far ASP.NET 1.1 hasn't provide sufficient
built-in support on it. Do you think postback the page to updating the
DataGrid is acceptable?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 3 '07 #3
Hi I am having same query as that of Pravin

But after fetching only the newly added/edited row and updating the dataset
again if we rebind the dataset it takes considerable time to display
whole data again. So is there any way to avoid this time or rebinding of
dataset to grid and still reflect the changes?
"Steven Cheng[MSFT]" wrote:
Hi Pravin,

From your description, you have an ASP.NET 1.1 page that display some
database record through DataGrid control, and you'll use a popup page to
add new record or editing existing record. Currently, you're wondering how
to make the added or changed record info passed to the parent page so as to
update the DataGrid, correct?

According to this issue, here are some of my understanding:

First, when adding new row or editing exist row, if you want to get the
updated/inserted new values, you should get the primarykey identity of the
certain record so that you can perform query to get the updated value
later. For editing row, this should not be a problem. For new inserted
record, the DBMS engine should provide statement for retrieving new
inserted record's identity(such as the @@Identity of SQL Server) or you can
manually control the PK of table record.

Here is a former thread discussing on retrieve new inserted
value(sqlserver)'s auto generated identity:

#Retrieving Identity Values after DetailsView Insert More options
http://groups.google.com/group/micro...rk.aspnet/brow
se_thread/thread/8a228fb82461ec04/60bc5c390c0542b2

Second, after you get the updated value, how would you like to update the
main DataGrid's displayed data? ASP.NET template databound controls
populate data(rows) through databinding. Therefore, if you want to update
DataGrid's UI, the expected ways is to redo the databinding on DataGrid to
the new datasource. Do you think this is what you want?

In addition, for AJAX, so far ASP.NET 1.1 hasn't provide sufficient
built-in support on it. Do you think postback the page to updating the
DataGrid is acceptable?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 4 '07 #4
Thanks for your input Pallavi,

Actually, no matter how we get the updated row info(through server-side
code, or use client-side script to retrieve the info by ajax way), for
updating the GridView or DataGrid(template databound control), you still
have to rebind the datasource to those controls. This is limited by the
ASP.NET databound control's model. GridView/DataGrid can only populate rows
via databinding, but not add/remove row on the fly.

BTW, what's your main concern here, are you wantting to avoid postback to
server or do not want additional databinding? For avoid postback
roundtrip, you can consider using the new ASP.NET ajax based page to make
the update without postback.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 5 '07 #5
Thanks Steven for your reply but

My requirement is

Refreshing the page is not a problem.For binding all records to datagrid for
the first time takes time is also not a problem.

But once whole data is fetched from the database then if we do any add,edit
or delete operation with the popup then again displaying data in the grid
onto the parent page should not take much time.

I want when we load data first time after that when we perform any operation
from the popup page (It may be adding a new record or updating the existing
one)
then it won’t take much time to reflect those changes into the grid

Can customize paging could be usefule which will fetch only the required
records for the selected page from the database?

Regards
Pallavi

"Steven Cheng[MSFT]" wrote:
Thanks for your input Pallavi,

Actually, no matter how we get the updated row info(through server-side
code, or use client-side script to retrieve the info by ajax way), for
updating the GridView or DataGrid(template databound control), you still
have to rebind the datasource to those controls. This is limited by the
ASP.NET databound control's model. GridView/DataGrid can only populate rows
via databinding, but not add/remove row on the fly.

BTW, what's your main concern here, are you wantting to avoid postback to
server or do not want additional databinding? For avoid postback
roundtrip, you can consider using the new ASP.NET ajax based page to make
the update without postback.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 6 '07 #6
Hi Pallavi,

Yes, I do agree that using custom paging would helps some if your record
set is large. Because when using custom paging, the databinding only need
to populate items of a single pagecount rather than all the records.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 9 '07 #7
Thanks Steven

But I wanted to know is there any alternative way to achieve this I mean
other than using custom paging.

"Steven Cheng[MSFT]" wrote:
Hi Pallavi,

Yes, I do agree that using custom paging would helps some if your record
set is large. Because when using custom paging, the databinding only need
to populate items of a single pagecount rather than all the records.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 9 '07 #8
Hi Pallavi,

So far for Gridview I haven't found any other better approach since its
databinding model restricted it on populating rows on the fly.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 12 '07 #9
Okay thanks Steven

"Steven Cheng[MSFT]" wrote:
Hi Pallavi,

So far for Gridview I haven't found any other better approach since its
databinding model restricted it on populating rows on the fly.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 13 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by kindermaxiz | last post: by
6 posts views Thread by Tony Stoker | last post: by
reply views Thread by Sooraj | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.