HighTechTalks DotNet Forums  

Edit Gridview using stored procesure

ASP.net Web Controls microsoft.public.dotnet.framework.aspnet.webcontrols


Discuss Edit Gridview using stored procesure in the ASP.net Web Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?TWFkaXNvbg==?=
 
Posts: n/a

Default Edit Gridview using stored procesure - 06-13-2007 , 02:45 PM






Hi all,
I'm try to write the code for gridview to delete, edit (only one or two
columns), page, sort using stored procedure to get dataTable to bind data
(avoid using SQLDataSource to bind data). All the samples I see always use
SQLDataSource which in the real business is not the good ideas.

Any ideas or samples would be appreciated.

Thank you.

Reply With Quote
  #2  
Old   
=?Utf-8?B?TWFkaXNvbg==?=
 
Posts: n/a

Default RE: Edit Gridview using stored procesure - 06-14-2007 , 09:23 AM






Hi Walter,

Thank you for your reply. I will try your coding and let you know how is
going.

Madison


Reply With Quote
  #3  
Old   
=?Utf-8?B?TWFkaXNvbg==?=
 
Posts: n/a

Default RE: Edit Gridview using stored procesure - 06-14-2007 , 11:56 AM



Hi Walter,

Thanks, the codes work very good.

I'm interest in using SqlDataSource with stored procedure can you refer to
web site that give more information? Do you have any pro and con on it?

Madison.



Reply With Quote
  #4  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: Edit Gridview using stored procesure - 06-15-2007 , 12:02 AM



Hi Madison,

When you use the wizard to configure SqlDataSource, in the step "How would
you like to retrieve data from your database", you can select "Specify a
custom SQL statement or stored procedure"; when you click next, you can
choose a stored procedure for the SELECT/UPDATE/INSERT/DELETE.

Hope this helps.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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


Reply With Quote
  #5  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default Re: Edit Gridview using stored procesure - 06-18-2007 , 04:03 AM



For a DropDownList, all you need to change in the demo code is to cast the
control returned from FindControl to a DropDownList and you should be able
to get the correct value selected the user currently.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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


Reply With Quote
  #6  
Old   
Matt
 
Posts: n/a

Default Re: Edit Gridview using stored procesure - 06-18-2007 , 03:00 PM



On Jun 18, 4:03 am, waw... (AT) online (DOT) microsoft.com (Walter Wang [MSFT])
wrote:
Quote:
For a DropDownList, all you need to change in the demo code is to cast the
control returned from FindControl to a DropDownList and you should be able
to get the correct value selected the user currently.

Regards,
Walter Wang (waw... (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Or, if you are using a SqlDataSource, as long as the parameter in the
Update command is the same as the field name (ie State = @State), it
should work without any hassle. also make sure you have the
DataKeyName set in your grid (it should be the primary key).



Reply With Quote
  #7  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: Edit Gridview using stored procesure - 06-21-2007 , 06:23 AM



Hi Madison,

Since I haven't seen your reply yet, I'm writing to check the status of
this post. Thanks.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.