By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

SqlDataSource

P: n/a
Is it possible to add records and edit records by hand using code on a
SqlDataSource and then save it on the server?

thanks,

Victor
Mar 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Yes it is, you can use the SQLDataSource.InsertCommand and the
SQLDataSource.UpdateCommand methods. The SQLDataSource control is mainly
designed so the you can retreive, add, update and delete records from the
database without writing musch or any code. If you want to do these things
through code you may find the standard ADO.net objects to be more flexible.

"Victor Rodriguez" wrote:
Is it possible to add records and edit records by hand using code on a
SqlDataSource and then save it on the server?

thanks,

Victor

Mar 23 '06 #2

P: n/a
can you give or point me to some samples?

Victor
"clickon" <cl*****@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
Yes it is, you can use the SQLDataSource.InsertCommand and the
SQLDataSource.UpdateCommand methods. The SQLDataSource control is mainly
designed so the you can retreive, add, update and delete records from the
database without writing musch or any code. If you want to do these
things
through code you may find the standard ADO.net objects to be more
flexible.

"Victor Rodriguez" wrote:
Is it possible to add records and edit records by hand using code on a
SqlDataSource and then save it on the server?

thanks,

Victor

Mar 24 '06 #3

P: n/a
Hi Victor,

Thanks for posting!

There are many samples demonstrate how to approach this. As far as I know,
if you want to update the GridView, please following the links below:
http://www.asp.net/QuickStart/aspnet.../gridview.aspx
http://msdn.microsoft.com/library/de...us/dnaspp/html
/GridViewEx04.asp

If you want to insert a new record, please following the links below:
http://www.codeproject.com/aspnet/addupdate.asp

In addition, all above samples is specific for the single functionality. If
you want to both update and insert a record in the current web application,
I recommend you use the GridView and the DetailsView control together to
implement the current requirement. Please refer to the following link:
http://www.devx.com/dotnet/Article/22141/1954?pf=true

Hope this will be helpful!

Regards,

Yuan Ren
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.

Mar 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.