473,378 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Saving data

I have a datagrid linked to a SQL Stored Procedure, the data is extracted
from 4 tables. Data is only updated not inserted and the update is to only 1
of the tables, the other three tables are information only. Can anybody help
with a save routine.
Jul 21 '05 #1
2 1307
You need a good book on ADO.NET to fish your way out of the relevant saving
routines. I've explained this fairly well in my book, but here is an
overview.

I assume the datagrid is bound to a dataset? You need SqlDataAdapter.Update
to persist the changes back to the d/b. You will have to worry about
a) Performance
b) Concurrency.
c) Ease of code.

Based on the above two, you could decide on using between a CommandBuilder
object/Automatic Update back to db, or Specify an UpdateCommand on the data
adapter object.

Beyond that it's all about calling a simple stored proc .. thats it :)

Also, there are many ways to skin this cat other than the above.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik

"Oldhandandy" <Ol*********@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
I have a datagrid linked to a SQL Stored Procedure, the data is extracted
from 4 tables. Data is only updated not inserted and the update is to only 1 of the tables, the other three tables are information only. Can anybody help with a save routine.

Jul 21 '05 #2
Create a stored procedure that updates the data, using a data adapter
and its corresponding update command property to save the changed
values in the dataset.

Catch you later,

Boyd

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: G-Factor | last post by:
Hi all I've just started learning about saving files. I got bit of a problem. The following code gives me an error about incompatible types. (Cannot covert from class character to char *). I...
4
by: John Kandell | last post by:
Hi, I posted this in the asp.net group, but didn't get a response. Maybe someone here can help me with this... --- Would someone be able to shed some light on what is the cost of saving a...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
3
by: JamesB | last post by:
I am saving image files from my website using the downloaddata on the web client. This gives me a byte array, which I am then saving to a file with the following code: ' Create the new, empty...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
10
by: JoeC | last post by:
I am writing a game and all my game pieces are stored in a single vector of piece handles. I have the basics I can read and write char and number files but I am trying to do comthing more...
2
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, My app picks ccurrent time on the PC to retrieve data from sql DB, the Sql data is always data with non-daylight saving. The app runs on PC with both daylight saving and non-daylight...
1
by: WebCM | last post by:
We can do it in different ways. Configuration data are sent by POST. Some of them should be parsed before saving to file. Perhaps, I will use var_export(). However, how to do it best? 1....
1
by: MSwanston | last post by:
Hi I need some help with saving retreiving data from the cache, and how best to structure my code. FYI am working in VS2005/under .NET2 Framework. Ok, we have a series of reports that get run via...
0
by: madhu raju | last post by:
iam saving the data into Ms-Access database using Vb.net Application In that application iam using Data grid view to save the data into the database Here in the below code iam saving the name of...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.