SqlDataSource

  • Thread starter Thread starter Victor Rodriguez
  • Start date Start date
V

Victor Rodriguez

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
 
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.
 
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/doc/ctrlref/data/gridview.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-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.
 
Back
Top