XML数据库 [英] XML Database

查看:77
本文介绍了XML数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个可以显示照片的简单网站,我想要整理和展示这些照片。


一个完整的数据库对于这个网站来说,这将是过度的。我想知道XML

文件是否可以用作简单的数据库。我知道这不会有效,但如果我可以打开,阅读,搜索,修改和保存内容,那么它好像很有效对我有好处。


并发也会很好,虽然我不认为这个网站需要'b
。 />

感谢您的任何提示。


Jonathan

解决方案

6月9日18:04,Jonathan Wood < jw ... @ softcircuits.comwrote:


我正在创建一个显示照片的简单网站,我想要

组织和展示。


一个完整的数据库对于这个网站来说是过度杀伤。我想知道XML

文件是否可以用作简单的数据库。我知道这不会有效,但如果我可以打开,阅读,搜索,修改和保存内容,那么它好像很有效对我有好处。


并发也会很好,虽然我不认为这个网站需要'b
。 />

感谢您的任何提示。


Jonathan



XML数据很好。只需要记住:


(1)任何时候都不支持多个用户在

修改数据。


(2)没有方便的SQL语言来检索数据

其中涉及联合表格。


ASP.NET确实支持使用XML的类型化数据集和

简单案例XmlDataSource用于绑定可视化控件。


我发现创建DataSet有用App_Code目录。

您可以使用自动增量和

表之间的关系来定义主键。然后创建一个名为DataObject的类文件,并将所有数据库处理放在那里。使用ObjectDataSources而不是
XmlDataSources,因为后一个对象只读取基于属性的
字段(除非你知道如何编写Xsl变换)。类型化的数据集

是节点格式的。


XML的一个很好的例子是基本上是静态的数据并且可以读取
普通用户,但有网站管理员的编辑设施。


性能明智我没有看到任何问题,除非数据量很大

非常大无论如何,它可能会保证SQL服务器。


HTH


" Jonathan Wood" < jw *** @ softcircuits.com写信息

新闻:uf ************** @ TK2MSFTNGP06.phx.gbl ...


感谢您的任何提示。



除了Stan的评论,我坚信使用正确的

工具来完成这项工作。 XML不是一个数据库,并且试图让它假装是
一个人总是,IMO,错误的解决方案。


你说一个完整的数据库对于这个网站来说是过度杀戮..我不是

真的很确定你的意思是什么?数据库,但有没有真正的原因

,你不能使用沼泽标准的Jet数据库?您可以立即获得ADO.NET的所有优势,以及您可能想要的所有并发性......


即使数据库只包含一个表,它比使用文本文件还要好得多

...

-

Mark Rae

ASP.NET MVP
http://www.markrae.net


Mark,


除了Stan的评论,我还是坚定的相信使用正确的

工具来完成工作。



确实。


你说一个完整的数据库对于这个网站来说是过度杀戮。我不是

我真的很确定你所说的完整是什么意思数据库,



例如Microsoft SQL Server 2005.


但是你有什么理由吗?不能使用沼泽标准Jet

数据库?当然,你拥有ADO.NET的所有优点,加上所有可能需要的并发...



这里''我的头脑中有几个原因:我不知道任何关于Jet数据库的b $ b,可能没有它,不知道如何使用它,不要'b

想要花一个星期的时间学习它,并怀疑它对我的需求来说也是过度的。


即使数据库只包含一个表,它仍然比使用文本文件好多了...



那么你似乎不同意Stan的评论?


谢谢。


Jonathan


I''m creating a simple site that will display photos, which I''d like to
organize and display.

A full database would be WAY overkill for this site. I''m wondering if an XML
files could be used instead as a simple database. I know it wouldn''t be as
efficient, but if I can open, read, search, modify and save the contents, it
seems like it would work pretty good for me.

Concurrency would be nice too, although I don''t really think that''s
necessary for this current site.

Thanks for any tips.

Jonathan

解决方案

On 9 Jun, 18:04, "Jonathan Wood" <jw...@softcircuits.comwrote:

I''m creating a simple site that will display photos, which I''d like to
organize and display.

A full database would be WAY overkill for this site. I''m wondering if an XML
files could be used instead as a simple database. I know it wouldn''t be as
efficient, but if I can open, read, search, modify and save the contents, it
seems like it would work pretty good for me.

Concurrency would be nice too, although I don''t really think that''s
necessary for this current site.

Thanks for any tips.

Jonathan

XML data is fine. Just need to remember:

(1) There is no support for more than one user modifying the data at
any one time.

(2) Don''t have the convenience of the SQL language for retrieving data
where joined tables are involved.

ASP.NET does have good support for typed datasets using XML and in
simple cases XmlDataSource for binding visual controls.

I find it useful to create DataSets in the App_Code directory. There
you can define primary keys with auto-increment and relations between
tables. Then create a class file named as being a DataObject and put
all your db handling in there. Use ObjectDataSources rather than
XmlDataSources because the latter object only reads attribute based
fields (unless you know how to write Xsl transforms). Typed datasets
are in node format.

A good case for XML is data that is largely static and read-ony to
ordinary users but with edting facilities for a site administrator.

Performance wise I don''t see any problem unless the volume of data is
very large which would probably warrant SQL server anyway.

HTH


"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:uf**************@TK2MSFTNGP06.phx.gbl...

Thanks for any tips.

In addition to Stan''s comments, I''m a firm believer in using the correct
tool for the job. XML is not a database, and trying to make it pretend to be
one is always, IMO, the wrong solution.

You say "a full database would be WAY overkill for this site".. I''m not
really sure what you mean by a "full" database, but is there any real reason
that you can''t use a bog-standard Jet database? Instantly, you have all of
the advantages of ADO.NET, plus all the concurrency you could want...

Even if the database contained only one table, it would still be much better
than using a text file...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Mark,

In addition to Stan''s comments, I''m a firm believer in using the correct
tool for the job.

Indeed.

You say "a full database would be WAY overkill for this site".. I''m not
really sure what you mean by a "full" database,

Microsoft SQL Server 2005, for example.

but is there any real reason that you can''t use a bog-standard Jet
database? Instantly, you have all of the advantages of ADO.NET, plus all
the concurrency you could want...

Here''s a couple of reasons off the top of my head: I don''t know anything
about Jet database, probably don''t have it, don''t know how to use it, don''t
want to spend a week learning it, and suspect it would also be overkill for
my needs.

Even if the database contained only one table, it would still be much
better than using a text file...

So then you appear to disagree with Stan''s comments?

Thanks.

Jonathan


这篇关于XML数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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