Re: update query in DataTable??
From: ZeroVisio (ZeroVisio_at_discussions.microsoft.com)
Date: 03/24/05
- Next message: Craig: "Re: Will VS 6.0 C++ #import a TLB created by regasm?"
- Previous message: Jon Skeet [C# MVP]: "Re: Addition and double value type question"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: update query in DataTable??"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: update query in DataTable??"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Mar 2005 14:03:02 -0800
yaah i just want to commit changes to datatable in memory. righnow i dont
intend to write this table to any database (but maybe in future if it is
needed). here is exactly what im trying to do.
i have seven columns and some rows in my datatable: here is my snapshot of
datatable
id, type,text, start, end, st_flg, end_flg
3, Strategy , pmts, 1, 2, N, N
5, Strategy , print, 1, 4, N, N
7, Strategy, Mail, 1, 6, N, N
now after checking a condiition i want to change N to Y in st_flg and/or
end_flg.
so I retrieve rows that match my criteria and want to update the st_flg
and/or end_flg. However all this in memory. no final commitment to database.
i thought of using datarow.itemarray.setvalue but then dont know how this
will reflect back to my table.
hope you can help!
"Nicholas Paldino [.NET/C# MVP]" wrote:
> ZeroVisio,
>
> But where do you want to make the changes to? Do you just want to
> commit them to the DataTable in memory? If that is the case, calling
> AcceptChanges will just make it so that the state of each row is unchanged.
> Basically, adds, edits, and deletes will be committed (there will not be an
> original row version).
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "ZeroVisio" <ZeroVisio@discussions.microsoft.com> wrote in message
> news:3E3CAA57-7846-40ED-9A54-9CE49EAA7549@microsoft.com...
> > Nicholas,
> >
> > thanks for the reply. I want to just update the dataTable. in my case I'm
> > not using datatable for getting data from any database. it is just a
> > dataholder (i found it easy to use datatable than two dimensional dynamic
> > array for searching certain elements in it).
> > So how do you it. I saw there is something like acceptChanges but I
> > couldn't
> > figure how to make changes! Help!!
> >
> > "Nicholas Paldino [.NET/C# MVP]" wrote:
> >
> >> ZeroVisio,
> >>
> >> If you mean to the back end data source that the data came from, no,
> >> there is not. You will have to create a data adapter that will update
> >> the
> >> table appropriately, and make sure that the table only has the change on
> >> that one row. Once you have that, you can run it through the data
> >> adapter,
> >> and the data on the back end should be updated.
> >>
> >> Hope this helps.
> >>
> >>
> >> --
> >> - Nicholas Paldino [.NET/C# MVP]
> >> - mvp@spam.guard.caspershouse.com
> >>
> >> "ZeroVisio" <ZeroVisio@discussions.microsoft.com> wrote in message
> >> news:3F03C52C-B3AD-4870-B665-CF0164232BA1@microsoft.com...
> >> > Hi,
> >> >
> >> > I want to know if there is an easy way to do update a column of a row
> >> > in
> >> > DataTable.
> >>
> >>
> >>
>
>
>
- Next message: Craig: "Re: Will VS 6.0 C++ #import a TLB created by regasm?"
- Previous message: Jon Skeet [C# MVP]: "Re: Addition and double value type question"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: update query in DataTable??"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: update query in DataTable??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|