473,657 Members | 2,921 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 1636
Yes it is, you can use the SQLDataSource.I nsertCommand and the
SQLDataSource.U pdateCommand 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*****@discus sions.microsoft .com> wrote in message
news:28******** *************** ***********@mic rosoft.com...
Yes it is, you can use the SQLDataSource.I nsertCommand and the
SQLDataSource.U pdateCommand 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.as p

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
4472
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 ControlParameter <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XYZ %>"
8
5031
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 select, remember it, and then use it in the update. It works just fine when I have full control of the whole process. I want to do the same for my GridView/SqlDataSource combinations. I typically select from a view and update the corresponding...
3
5066
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 having problems making this work. Inside connectionStrings I added my name, provider and connectionString but for some reason SqlDataSource is trying to use System.Data.SqlClient even if my provider is different.
3
2225
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 charm, but when i want to pass the data through the application's layers (BL etc.), it did not work. it seems that the 'AutoGenerateEditButton' is capable only with sqlDataSource...
3
6398
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 sqldatasource. Conflictdetection set to compareallvalues. Oldvaluesparameterformatstring set to original_{0} tblA has 2 fields. ID and MyText. Deletecommand="Delete from tblA where ID=@original_ID"
3
4522
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 DataField="ProductID" HeaderText="ProductID" InsertVisible="False"ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
5
7681
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, the compiler believes an SQL db is being accessed ("An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does...
2
1991
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 several items. The reason I'm wondering if I should use an SqlDataSource object is overhead. For example, prior to learning about the sqlDataSource I would just code the ado.net procedure myself. For example, create connection object, create and...
2
2081
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 /> <asp:SqlDataSource ID="SqlSons" runat="server" SelectCommand="SELECT a, b FROM c WHERE d = 74" /> The problem is that Eval("a") always return the value from SqlStructure.
0
1252
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 be the ID of a control of type IDataSource. A control with ID 'SqlDataSourceGroup' could not be found." I've been suggested to move the SqlDataSource out of the Accordion to get rid of the error message above, but when I do so the SqlDataSource
0
8385
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8602
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.