473,385 Members | 1,275 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.

Release lock on XML file

I'm reading an XML file on our web server using a DataSet. I then bind it
to a DataGrid. What's the proper method of releasing the lock on the file?

DataSet ds = new DataSet();
ds.ReadXML(fileName);
dg.DataSource = ds;
dg.DataBind();

Thanks in advance.
Mark

Nov 18 '05 #1
2 2504
how about using

ds.Dispose();

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:OD*************@TK2MSFTNGP12.phx.gbl...
I'm reading an XML file on our web server using a DataSet. I then bind it
to a DataGrid. What's the proper method of releasing the lock on the file?
DataSet ds = new DataSet();
ds.ReadXML(fileName);
dg.DataSource = ds;
dg.DataBind();

Thanks in advance.
Mark

Nov 18 '05 #2
DataSet ds = new DataSet();
ds.ReadXML(fileName);
dg.DataSource = ds;
dg.DataBind();
ds.Dispose(); // dipose the dataset after binding it. that should release
the xml file

sorry about the previous oneliner. i think i should call it a day now. hope
this helps

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:OD*************@TK2MSFTNGP12.phx.gbl...
I'm reading an XML file on our web server using a DataSet. I then bind it
to a DataGrid. What's the proper method of releasing the lock on the file?
DataSet ds = new DataSet();
ds.ReadXML(fileName);
dg.DataSource = ds;
dg.DataBind();

Thanks in advance.
Mark

Nov 18 '05 #3

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

Similar topics

4
by: John P. Speno | last post by:
So you have this problem, and you decide to use threads to solve it... System is Python 2.3.3 on Solaris 9. I'm using the classic Python thread model. Main thread puts stuff into a...
2
by: Sharon | last post by:
I’m writing a thread wrapper for a safe thread termination by using stop event. Whenever the thread stop event is signaled, I want to release the thread in case it’s blocked on Monitor.Enter()...
14
by: Gary Nelson | last post by:
Anyone have any idea why this code does not work? FileOpen(1, "c:\JUNK\MYTEST.TXT", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Shared) Dim X As Integer For X = 1 To 26 FilePut(1, Chr(X +...
0
by: Lonewolf | last post by:
Hi I'm faced with a very pesky problem. I have a managed assembly done in C++/CLI which interface to native C++ codes, and a C# app which consumes this assembly. I realize that when both the app...
0
by: BobAchgill | last post by:
Is there a way to get AxWindowsMediaPlayer1.URL to release it's lock on the file it has finished playing? Because it is not letting go of the resource I cannot delete the file and re-record it...
1
by: satish mullapudi | last post by:
Hi all, I am using DB2 v 8.2 , Win XP OS. I have creaed a sample situation which results in a deadlock created by appl1 & appl2.Now, I want to release one of the locks (using CLP, not Control...
5
by: pgdown | last post by:
Hi, I have several processes accessing files from one folder, but only one process should ever access each file. Once one process has the file, no other process should be allowed to access it,...
2
by: Piotr Sobolewski | last post by:
Hello, I have such program: import time import thread def f():     global lock     while True:         lock.acquire()         print thread.get_ident()
6
by: Delaney, Timothy (Tim) | last post by:
Piotr Sobolewski wrote: 1. You should use the threading module. 2. No need for the "global lock" statement here - you're not rebinding the name "lock". 3. These aren't daemon threads, so...
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: 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...
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: 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...
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.