473,385 Members | 1,351 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,385 software developers and data experts.

dataadapter update special logic

gl
I'm currently planning out a project and I wanted to make sure it's easy to
do something (or at least possible). Basically we're going to have a grid
reporting off of dataset (with a relative dataadapter). My question revolves
around the dataadapter's update ability. First of all the dataset will
contain multiple tables. Now when the Update method is called, there has to
be special logic. Basically, if the user has changed the text of a certain
column in the record, that record is not simply updated. It is copied to a
new record, it's old xref reference is deleted, and a new one is made to the
new record (to keep the old record data in tact). I think that i might be
able to pull this off using only sql (will that work in the context of an
update), but i'd rather do code. Is it possible to like override the update
call and put a bunch of .net code in to work with the records being updated?
not sure.

Thank for any help.
Nov 17 '05 #1
3 1306
gl,

Instead of coding the update call, why not create a stored procedure
that does this, and then have the update command on your data adapter use
that?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gl" <gl@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
I'm currently planning out a project and I wanted to make sure it's easy
to
do something (or at least possible). Basically we're going to have a grid
reporting off of dataset (with a relative dataadapter). My question
revolves
around the dataadapter's update ability. First of all the dataset will
contain multiple tables. Now when the Update method is called, there has
to
be special logic. Basically, if the user has changed the text of a certain
column in the record, that record is not simply updated. It is copied to a
new record, it's old xref reference is deleted, and a new one is made to
the
new record (to keep the old record data in tact). I think that i might be
able to pull this off using only sql (will that work in the context of an
update), but i'd rather do code. Is it possible to like override the
update
call and put a bunch of .net code in to work with the records being
updated?
not sure.

Thank for any help.

Nov 17 '05 #2
gl
I guess for the purposes of this, i can probably use a stored procedure (as
the requirements stand), i was just wondering about other options. Like
suppose i wanted to write the id out to a file when it was updated or
something. How would I go about doing that (i guess do somethign that's not
easily done via sql)?

Thanks for your help.

"Nicholas Paldino [.NET/C# MVP]" wrote:
gl,

Instead of coding the update call, why not create a stored procedure
that does this, and then have the update command on your data adapter use
that?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gl" <gl@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
I'm currently planning out a project and I wanted to make sure it's easy
to
do something (or at least possible). Basically we're going to have a grid
reporting off of dataset (with a relative dataadapter). My question
revolves
around the dataadapter's update ability. First of all the dataset will
contain multiple tables. Now when the Update method is called, there has
to
be special logic. Basically, if the user has changed the text of a certain
column in the record, that record is not simply updated. It is copied to a
new record, it's old xref reference is deleted, and a new one is made to
the
new record (to keep the old record data in tact). I think that i might be
able to pull this off using only sql (will that work in the context of an
update), but i'd rather do code. Is it possible to like override the
update
call and put a bunch of .net code in to work with the records being
updated?
not sure.

Thank for any help.


Nov 17 '05 #3
gl,

In .NET 2.0, all of the data adapters derive from DbDataAdapter. You
could derive a class from your providers implementation of DbDataAdapter (if
it is not sealed), and then override the OnRowUpdated method so that you
could perform your processing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gl" <gl@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
I guess for the purposes of this, i can probably use a stored procedure (as
the requirements stand), i was just wondering about other options. Like
suppose i wanted to write the id out to a file when it was updated or
something. How would I go about doing that (i guess do somethign that's
not
easily done via sql)?

Thanks for your help.

"Nicholas Paldino [.NET/C# MVP]" wrote:
gl,

Instead of coding the update call, why not create a stored procedure
that does this, and then have the update command on your data adapter use
that?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gl" <gl@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
> I'm currently planning out a project and I wanted to make sure it's
> easy
> to
> do something (or at least possible). Basically we're going to have a
> grid
> reporting off of dataset (with a relative dataadapter). My question
> revolves
> around the dataadapter's update ability. First of all the dataset will
> contain multiple tables. Now when the Update method is called, there
> has
> to
> be special logic. Basically, if the user has changed the text of a
> certain
> column in the record, that record is not simply updated. It is copied
> to a
> new record, it's old xref reference is deleted, and a new one is made
> to
> the
> new record (to keep the old record data in tact). I think that i might
> be
> able to pull this off using only sql (will that work in the context of
> an
> update), but i'd rather do code. Is it possible to like override the
> update
> call and put a bunch of .net code in to work with the records being
> updated?
> not sure.
>
> Thank for any help.


Nov 17 '05 #4

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

Similar topics

5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
2
by: hch | last post by:
dataAdapter.Update(data, "TableName") won’t work! I was about to deploy my first website on the Internet only to discover that the dataAdapter.Update() throws the Server Error in the third...
3
by: Eric A. Johnson | last post by:
I'm using ADO style. I have an Access database with four tables that I will want to do queries on. I will want to do queries on all four tables, at least individually, and possibly at the same...
6
by: Andrew Cooper | last post by:
Greetings, I'm running into a little problem with a Dataadapter object. I'm using it to fill a Datatable but when I later try to Update the database using the Dataadapter.Update method, I get...
13
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
1
by: Franklin M. Gauer III | last post by:
I create a simple DATAADAPTER in a webservice project. It creates the UPDATE, INSERT, DELETE commands for me - no problem. In vS2005 it creates these commands as RESOURCES in the RESX file (i.e....
2
by: Franklin M. Gauer III | last post by:
I create a simple DATAADAPTER in a webservice project. It creates the UPDATE, INSERT, DELETE commands for me - no problem. In vS2005 it creates these commands as RESOURCES in the RESX file (i.e....
6
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.