473,503 Members | 4,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlDataSource

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
3 1622
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4459
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a...
8
5013
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
3
5052
by: zapov | last post by:
Hi! Did anyone successfully managed to use some custom ADO.NET provider with SqlDataSource? I'd like to connect to some other database than MSSQL (like MySQL, Firebird or PostgreSQL) but I'm...
3
2215
by: adam222 | last post by:
hello, i have a web-form with a GridView control, i wanted to update & delete, using the AutoGenerateEditButton. when i used it with sqlDataSource (executing SP in the DB) it works like a...
3
6386
by: Jim Andersen | last post by:
Just to let you know, and to help any future sorry sods who gets trapped in the same black hole...... You can't just copy/move a working sql-statement into a stored procedure. Working with a...
3
4511
by: simonZ | last post by:
In gridView I have dropdown list : <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField...
5
7674
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason,...
2
1982
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or...
2
2071
by: Julien Sobrier | last post by:
Hello, I have 2 SqlDataSource on the same page that retrieve the same column names: <asp:SqlDataSource ID="SqlStructure" runat="server" SelectCommand="SELECT a, b FROM c WHERE d = 0 /> ...
0
1241
by: staeri | last post by:
I have a dropdownlist attached to a SqlDataSource inside an Accordion. I receive the following error message when the SqlDataSource is inside the Accordion: "The DataSourceID of 'ddGroup' must...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.