将数据集写入数据库字段 [英] Write Dataset to Database Field

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

问题描述

大家好,


我有一个问题,我如何将整个数据集写入SQLServer的NTEXT字段。


可以有人帮帮我吗?


谢谢!


/迈克


---

发表于使用Wimdows.net NntpNews组件 -


发布自 http://www.DotNetJunkies.com/newsgroups 我们的新闻组引擎支持发布警报,评级和搜索。

Hi all,

I have a question on how can I write the entire Dataset to a NTEXT field of SQLServer.

Can anyone help me?

Thanks!

/mike

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.

推荐答案

您好


我不知道NTEXT字段是否足够大,但是要从数据集中创建一个String

,您可以使用数据集GetXML 。


我的一个愿望是有一个数据集SetXML,因为你有

作为XMLdoc循环它以使它回到数据集据我所知

知道。


或许Jon在我看来对于那个最后一个特殊的解决方案

序列化(我非常认真地对待Jon,也许是一个很好的挑战

当你看到这个时,我也可以将它作为一个数据集真正序列化为一个

中的3个架构类型,但也没有反序列化。我不在哪里

谈论使用dataset.writexml和readxml通过磁盘这是一个

小菜一碟。


Cor
Hi

I do not know if a NTEXT field is large enough, however to make a String
from a dataset you can use dataset GetXML.

One of my wishes is that there was a dataset SetXML because you while have
to loop through it as an XMLdoc to get it back to a dataset as far as I
know.

Or maybe Jon has a solution for that last as a specialis in my opinion for
serialization (I am seriously strugling with that Jon, maybe a nice chalenge
for you when you see this, I can also serialize it real as a datset with one
of the 3 schematypes in it, but also not deserialize that. Where I am not
talking about doing it with dataset.writexml and readxml via disk that is a
piece of cake).

Cor





我不知道NTEXT字段是否足够大,但是要创建一个String 你可以使用数据集GetXML。


我的一个愿望是有一个数据集SetXML,因为你有

我将它作为一个XMLdoc进行循环,以便将它返回到数据集中,直到我知道。


或者Jon可以为最后一个提供解决方案在我看来这是一个特殊的

序列化(我非常认真地对待Jon,也许是一个很好的挑战

,当你看到这个时,我也可以将它序列化为真实的其中包含3个架构类型中一个

的数据集,但也没有反序列化。我不在哪里?b $ b谈论使用dataset.writexml和readxml通过磁盘这样做是一块

的蛋糕。) >

Cor
Hi

I do not know if a NTEXT field is large enough, however to make a String
from a dataset you can use dataset GetXML.

One of my wishes is that there was a dataset SetXML because you while have
to loop through it as an XMLdoc to get it back to a dataset as far as I
know.

Or maybe Jon has a solution for that last as a specialis in my opinion for
serialization (I am seriously strugling with that Jon, maybe a nice chalenge
for you when you see this, I can also serialize it real as a datset with one
of the 3 schematypes in it, but also not deserialize that. Where I am not
talking about doing it with dataset.writexml and readxml via disk that is a
piece of cake).

Cor


>我不知道NTEXT字段是否足够大,但是要从数据集中创建Strin
> I do not know if a NTEXT field is large enough, however to make a Strin
,您可以使用数据集GetXML


引用SQL Server Books OnLineNTEXT是可变长度的Unicode数据,最大长度为230 - 1(1,073,741,823)个字符

我的一个愿望是有一个数据集SetXML,因为你有hav
将其作为XMLdoc循环以将其返回到数据集,直到知道
from a dataset you can use dataset GetXML
To quote SQL Server Books OnLine "NTEXT is Variable-length Unicode data with a maximum length of 230 - 1 (1,073,741,823) characters
One of my wishes is that there was a dataset SetXML because you while hav
to loop through it as an XMLdoc to get it back to a dataset as far as
know



使用StringReader查看数据集的WriteXML / ReadXML。以下是MSDN文档中的一个示例


如果Page.IsPostBack

Dim sr为New System.IO.StringReader(CStr(ViewState(" dsCustomers) ))

DsCustomers1.ReadXml(sr

Els

SqlDataAdapter1.Fill(DsCustomers1

Dim sw as新的System.IO.StringWriter(

DsCustomers1.WriteXml(sw

ViewState(" dsCustomers")= sw.ToString(

结束我


----- Cor Ligthert写道:----


H


我不知道NTEXT字段是否足够大,但是要从数据集中制作一个Strin

你可以使用数据集GetXML


我的一个愿望是有一个数据集SetXML,因为你可以将它作为一个XMLdoc循环通过它,然后将它返回到数据集,直到

知道


或许Jon在我的观点中为最后一个解决方案提供了一个特殊的解决方案(b
序列化)(我真的很喜欢那个Jon,也许是一个很好的chaleng

当你看到这个时,我也可以将它真正序列化为一个数据集,其中有3个架构类型,但也没有反序列化。我不在哪里

谈论使用dataset.writexml和readxml通过磁盘来做这件事

一块蛋糕)


公司



Look at WriteXML/ReadXML of the dataset using StringReader. Here is an example from the MSDN documents

If Page.IsPostBack The
Dim sr as New System.IO.StringReader(CStr(ViewState("dsCustomers "))
DsCustomers1.ReadXml(sr
Els
SqlDataAdapter1.Fill(DsCustomers1
Dim sw as New System.IO.StringWriter(
DsCustomers1.WriteXml(sw
ViewState("dsCustomers") = sw.ToString(
End I

----- Cor Ligthert wrote: ----

H

I do not know if a NTEXT field is large enough, however to make a Strin
from a dataset you can use dataset GetXML

One of my wishes is that there was a dataset SetXML because you while hav
to loop through it as an XMLdoc to get it back to a dataset as far as
know

Or maybe Jon has a solution for that last as a specialis in my opinion fo
serialization (I am seriously strugling with that Jon, maybe a nice chaleng
for you when you see this, I can also serialize it real as a datset with on
of the 3 schematypes in it, but also not deserialize that. Where I am no
talking about doing it with dataset.writexml and readxml via disk that is
piece of cake)

Co


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

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