DataSet.WriteXml拒绝写... [英] DataSet.WriteXml refuses to write...

查看:103
本文介绍了DataSet.WriteXml拒绝写...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨NG,


我不知道为什么,但是因为一段时间数据集拒绝写入

特定的xml文件。

我收到错误消息Der Zugriff auf den Pfad

D:\ VSS5Projects \ BfpNet \ BfpNet \bin \Debug \ Bfp.xml wurde verweigert其中

转换为:

访问路径D:\ VSS ......被拒绝。


数据集可以从这个Bfp.xml中读取而没有任何问题。

该文件没有设置只读标志或我可以识别的任何其他东西

导致这个问题。

如果我读了xml,请在我再次写入之前不久设置一个断点,

删除文件,ds.WriteXml从那时起工作正常。现在我可以开始/停止

我的应用程序并修改xml,按照我的意愿阅读它,我没有更多

问题。


为什么我不能写入原始的xml?


感谢提示和帮助。


问候

Rainer Queck

解决方案

9月19日下午1:50,Rainer Queck < Rai ... @ noemail.noemailwrote:


< snip>


为什么我不能写信给原始的xml?



听起来你可能仍然打开文件进行阅读。如果您写一个不同的文件(在同一目录中)

感兴趣,会发生什么?b $ b?或者使用空数据集写入文件(即没有

从中读取)?


Jon


Rainer Queck写道:


你好NG,


我不知道为什么,但是因为有一段时间数据集拒绝写入

特定的xml文件。

我收到错误消息Der Zugriff auf den Pfad

D:\ VSS5Projects \BfpNet \ BfpNet \bin\Debug \ Bfp.xml wurde verweigert其中

转换为:

访问路径D:\ VSS ......被拒绝。


数据集可以从这个Bfp.xml中读取而没有任何问题。

该文件没有设置只读标志或我可以识别的任何其他东西

导致这个问题。

如果我读了xml,请在我再次写入之前不久设置一个断点,

删除文件,ds.WriteXml从那时起工作正常。现在我可以开始/停止

我的应用程序并修改xml,按照我的意愿阅读它,我没有更多

问题。


那么为什么我不能写入原始的xml?



以下是真的吗?


- 该文件当前未被使用/被其他人锁定(或相同) )

应用程序。

- 尝试写入xml文件的用户有权写入它。

- 错误消息中的路径是正确的。

克里斯。


也许对原始文件的引用仍然被锁定,因为它是

还没有收集垃圾吗?你需要在

文件上调用.Dispose()?


或许发布你的代码?


Rainer Queck < Ra **** @ noemail.noemailwrote in message

news:eo ****************** @ TK2MSFTNGP04.phx.gbl .. 。


嗨NG,


我不知道为什么,但是因为一段时间数据集拒绝写入

特定的xml文件。

我收到错误消息Der Zugriff auf den Pfad

D:\ VSS5Projects\BfpNet \ BfpNet \\\\Debug; \\ Bfp.xml wurde verweigert其中

转换为:

访问路径D:\ VSS ......被拒绝。


数据集可以从这个Bfp.xml中读取而没有任何问题。

该文件没有设置只读标志或我可以识别的任何其他东西

导致这个问题。

如果我读了xml,请在我再次写入之前不久设置一个断点,

删除文件,ds.WriteXml从那时起工作正常。现在我可以开始/停止

我的应用程序并修改xml,按照我的意愿读取它,我没有

更多问题。


为什么我不能写入原始的xml?


感谢提示和帮助。


问候

Rainer Queck



Hi NG,

I have no idea why, but since a while a dataset refuses to write to a
specific xml file.
I get the error message "Der Zugriff auf den Pfad
D:\VS2005Projects\BfpNet\BfpNet\bin\Debug\Bfp.xml wurde verweigert" which
translates to:
"The access to the path D:\VS...... was denied".

The dataset can read from this Bfp.xml without any problems.
The file has no read only flag set or any thing else I can identify as a
cause to this problem.
If I read the xml, set a breakpoint shortly before I write to it again,
delete the file, ds.WriteXml works fine from then on. Now I can start/stop
my app and modify the xml, read write it as often as I want, I have no more
problems.

So why cant I write to the original xml?

Thanks for hints and help.

Regards
Rainer Queck

解决方案

On Sep 19, 1:50 pm, "Rainer Queck" <Rai...@noemail.noemailwrote:

<snip>

So why cant I write to the original xml?

Sounds like you might still have the file open for reading. What
happens if you write to a different file (in the same directory) out
of interest? Or write to the file with an empty dataset (i.e. not
having read from it)?

Jon


Rainer Queck wrote:

Hi NG,

I have no idea why, but since a while a dataset refuses to write to a
specific xml file.
I get the error message "Der Zugriff auf den Pfad
D:\VS2005Projects\BfpNet\BfpNet\bin\Debug\Bfp.xml wurde verweigert" which
translates to:
"The access to the path D:\VS...... was denied".

The dataset can read from this Bfp.xml without any problems.
The file has no read only flag set or any thing else I can identify as a
cause to this problem.
If I read the xml, set a breakpoint shortly before I write to it again,
delete the file, ds.WriteXml works fine from then on. Now I can start/stop
my app and modify the xml, read write it as often as I want, I have no more
problems.

So why cant I write to the original xml?

Are the following true?

- The file is not currently in use/locked by some other (or the same)
application.
- The user trying to write to xml file has permissions to write to it.
- The path in the error message is correct.
Chris.


Perhaps the reference to the original file is still ''locked'' because it
hasn''t been garbage collected yet? Do you need to call .Dispose() on the
file?

Perhaps post your code?

"Rainer Queck" <Ra****@noemail.noemailwrote in message
news:eo******************@TK2MSFTNGP04.phx.gbl...

Hi NG,

I have no idea why, but since a while a dataset refuses to write to a
specific xml file.
I get the error message "Der Zugriff auf den Pfad
D:\VS2005Projects\BfpNet\BfpNet\bin\Debug\Bfp.xml wurde verweigert" which
translates to:
"The access to the path D:\VS...... was denied".

The dataset can read from this Bfp.xml without any problems.
The file has no read only flag set or any thing else I can identify as a
cause to this problem.
If I read the xml, set a breakpoint shortly before I write to it again,
delete the file, ds.WriteXml works fine from then on. Now I can start/stop
my app and modify the xml, read write it as often as I want, I have no
more problems.

So why cant I write to the original xml?

Thanks for hints and help.

Regards
Rainer Queck



这篇关于DataSet.WriteXml拒绝写...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆