To copy or not to copy: that is the question

i have a dataTable in the session object . I have a method which removes a column from the table before binding e.g.


DataTable dt = (DataTable) Session["MyTable"];
dt.Columns.RemoveAt[0];
DataGrid dg = new DataGrid();
dg.DataSource = dt;
// ...etc

a dataTable is a reference object so by removing the column in my local method I am also removing a column from the dataTable in the session object as they are both looking at the same thing.
what if I want to remove a column in my local method but preserve the integrity of the in session table? at the moment I am copying the table. is this the best way though? i.e.

DataTable dt = (DataTable) Session["MyTable"].Copy();
// ...etc


0
Wee
2/18/2005 4:29:55 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

0 Replies
759 Views

Similar Articles

[PageSpeed] 32

Reply:

Similar Artilces:

Copy Page > Copy Modules > Copy Content question
Hi I have just copied a page and it's modules, and I selected the Copy Content option. (changing a DNN2 module page to a DNN3 module page) I then started to customise my new page and update the modules, and I noticed that the ORIGINAL page changed to the new content as well. It's almost like a reference to the old page and you are editing one version of the code only - should copy not copy the data and then thats it - if you want to edit the new content it is completely detached from the copied content (similar to copying a file on the file system?) Or have I missed something? R...

FileConents not getting copied with File.Copy
string path = Session["FullPath"].ToString(); // Create the file and clean up handles.using (FileStream fs = File.Create(path)) { } // Ensure that the target does not exist.   // string path2 = @"C:\Inetpub\wwwroot\WebSite1\Images\" + strFolderName + @"\" + FileName;string path2 = Server.MapPath("Images"); path2 = path2 +"\\"+ strFolderName + "\\" + FileName;File.Copy(path1,path2); //File.Move("C:\\Inetpub\\wwwroot\\WebSite1\\Images\\Patient1\\120_UK_15.10.2030.bmp", "C:\\Inetpub\\wwwroot\\WebSite1\\Ima...

FTP: How to COPY TO and COPY FROM
In IE, I can COPY TO and COPY FROM the FTP sites I log onto. How do I do this with FireFox 9.3? I FTP with embedded UserName and Password. Thank you. Charles Hart Enzer, M.D. wrote: >In IE, I can COPY TO and COPY FROM the FTP sites I log onto. > >How do I do this with FireFox 9.3? > >I FTP with embedded UserName and Password. > >Thank you. > > I'm not sure if the procedure is exactly the same in FireFox, but in Mozilla, to copy from, just shift+click the file, while to copy to, use File/Upload. -- Warning: May contain traces of n...

Getting Started with .net and a few questions
Hello I've done some asp and php programming along with various other languages in the past and slowing getting my head around .net.I have a small project of creating a Holiday Booking system on our Intranet and just trying to get the first part to work properly will hopefully get me sorted for the whole project. The Intranet is running on .net 2 and I prefer to use the VB code rather than C#. This is connecting to an SQL server.My initial page that I am trying to create is just for an admin user to view which dates in a table have been specified as Bank Holidays and be able to add ...

Where can I get a copy of PB 9 Beta/Eval copy
Can someone point me to a download site where i can obtain a copy of the bete or eval package? The beta is closed now, you'll have to wait for the GA. On Sat, 25 Jan 2003 21:00:37 -0500, in powersoft.public.powerbuilder.futures_discussion carey mould <cmould@emoquad.com> wrote: >Can someone point me to a download site where i can obtain a copy of the >bete or eval package? > > Bruce Armstrong [TeamSybase] http://www.teamsybase.com Not 1 - but 2 new books on developing with PowerBuilder http://www.pb9books.com If you would like to continue to b...

Newbie Question
I have a new project which has just started. One of the requirements is to generate XML files. Do I have to create schema files? Does anyone have a tutorial or sample code to help me get started. I have some background using XML, but not in .NET. Thx Mark How to create a new xml file with XmlDocument? More examples hereSonu Kapoor [MVP] Feel free to ask me any .NET question | Ajax Data Controls Forum Thanks, this is very helpful. What do I need to do extra to setup the schema for this xml file? Is the schema really necessary as well? Thx Mark You dont need to define any sc...

Copy Project w/ VS2003.NET Questions
I'm fairly new to VS, but I'm trying to do things right and only move the bare essentials to my webserver. I opened the .sln file, and went into the Configuration Manager. I set all the projects to "Release" and then chose Build Solution. It built all 4 projects (DNN, the two Providers and YourCompanyName.Survey) sucesfully. I am using Win XP Pro and I wiped out all of my old DNN stuff. Clean install. I created a new directory called C:\Deploy and made it share (just like C:\DotNetNuke). I also made sure that ASPNET had Full Control on the Security Tab. In IIS, I created a ne...

PB11, only get one copy when multiple copies selected using new PB11 RTE dw
I have now re-written the dw using the new PB11 RTE dw and I still only get 1 copy when I select 2 copies. Can anyone help with this? Any suggestions? Thanks in advance, Randy "Randy King" <rking@tsp.sheridan.com> wrote in message news:46fc116a@forums-1-dub... > One more thing. I have not recreated the RTE dw in PB11. Maybe I have to > do this. It is a pain though. > > Thanks, > Randy > > > "Randy King" <rking@tsp.sheridan.com> wrote in message > news:46fc10f6@forums-1-dub... >>I have just migrated my app&#...

copy question
Hi, I am pretty new with Novell, I am trying to copy files from my floppy to my SYS volume. But it does not seem to work. I tried copy or cp. Is there a command that enables to copy. Thanks Denis I assume you are doing from the server console ? If so, you need TOOLBOX.NLM http://support.novell.com/cgi-bin/search/searchtid.cgi?/2958910.htm -- Edison Ortiz Novell Support Connection SysOp (No Email Support, Thanks !) I tried loading toolbox from a floppy, it did not work. Here is what I did and the error it gave me: load a:\toolbox.nlm Server-5.00-9...

Copying a copy protected floppy
Bit nervous about asking this - but I believe I am being honest so I'm going to ask anyway... I have an old piece of software (1996) that runs under Windows and came on three floppy diskettes. It's software that did not sell in high numbers as it is specifically useful to a particular industry (I do not want to go into the name of the product). I get three installs of the software. When I remove the software I get an install back onto the floppy. Over the years I've lost two of the installs. One went on a laptop which won't boot any more - it just died. An...

Shalow copy and deep copy
what is hte difference between shallow copy & deep copy? In a shallow copy any objects referenced by the object being copied are not copied. In a deep copy, objects referenced by the object being copied are also copied. imagine object A that has a property set to point to object B A -> B now we do a shallow copy A1 -> B A and A1 both share the same instance of object B If we instead had done a deep copy then we'd get A1 -> B1    Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.teler...

Copy error with File::Copy
Hi, I used the File::Copy module to copy() 4 files from a PC server to a Mac external firewire drive. Three of the four files copied great! (Thanks for all your help on that.) The one file that didn't copy was a QuickBooks database file. When the perl script ran, I got the following error: Can't copy file /Volumes/PRINCETON;DELLSERVER-1/DatabaseQB.QBW to /Volumes/10GB Firewire Drive/DatabaseQB.QBW-05-04-04.bak - Resource deadlock avoided A file called DatabaseQB.QBW-05-04-04.bak WAS created, BUT it had 0k in the file. The other three copied fine. Just this one...

copy question
Hi, I am pretty new with Novell, I am trying to copy files from my floppy to my SYS volume. But it does not seem to work. I tried copy or cp. Is there a command that enables to copy. Thanks Denis Most likely, you do not have rights. Assuming you have rights, any method or command that you could use to copy a file to your "C" drive would allow you to copy the to the server. If you are the LAN admin, try logging in the the "ADMIN" account. If you are not, try asking your LAN admin to assign your ID the "RFWCE" rights to that volem R(...

eegads! File::Copy not copying
Everything "was" perfect in my little program. I gave it a test run today. My file which copies some demofiles is sending blank empty files. I've used -e to make sure it exists and checked the return value on the copy(). Both check out fine. But the files have no content. Any suggestions? This is a snippet from one copy statement: my$ok = ""; $ok = copy("/$htmlroot/$htmldir/demosite/$filenames[$i]","/$htmlroot/$htmldir/$files[$i]") || push(@messages, "Couldn't copy /$htmlroot/$htmldir/demosite/$filenames[$i],\n to /$h...

Web resources about - To copy or not to copy: that is the question - asp.net.getting-started

German question - Wikipedia, the free encyclopedia
"Kleindeutschland" redirects here. For the neighborhood in New York City, see Little Germany, Manhattan . 1820 map of Central Europe showing ...

British backpacker murders: Burma army chief questions court verdict
THE head of Myanmar’s military has joined growing criticism against the death sentences handed down to two migrants for murdering a pair of British ...

Doctors question timing of Medicare cuts by Health Minister Sussan Ley
Doctors have criticised the Turnbull government for using the Christmas-New Year holiday period to reveal&nbsp;the first tranche of items&nbsp;to ...

Seven Questions With Spotify On Beatles Twitter Campaign
To keep excitement alive about Beatles songs finally being added to its streaming platform, Spotify launched a social media campaign with customized ...

A question of faith - with a lower case 'f'
Essay: What happens when you leave your Faith with an upper case 'F' to pursue faith with a lower case 'f'?

SunEdison Drops 7%: Merrill Lauds Disclosure, UBS Questions Cost of Funding
Shares of solar energy system installation firm SunEdison ( SUNE ) today closed down 43 cents, over 7%, at $5.49, amidst mixed coverage from ...

4 burning questions I have after seeing ‘Star Wars: The Force Awakens’
So it finally happened: I saw Star Wars: The Force Awakens on Christmas and I managed to see it without reading any spoilers beforehand despite ...

8 burning questions everyone has about 'Star Wars: The Force Awakens' and the best fan theory answers ...
Warning: There are massive spoilers ahead. Do not read on if you have not seen "Star Wars: The Force Awakens." Hopefully by now you've seen ...

Question #10 for 2016: How much will housing inventory increase in 2016?
Yesterday I posted some questions for next year: Ten Economic Questions for 2016 . I'll try to add some thoughts, and maybe some predictions ...

With 'affluenza' teen's capture, questions about justice in America
Christian Science Monitor With 'affluenza' teen's capture, questions about justice in America Christian Science Monitor The case of Ethan ...

Resources last updated: 12/30/2015 2:06:34 AM