如何在BLOB(二进制大对象)中的SQL数据库中存储整数数组 [英] How to store integer-array in SQL-Database in a BLOB ( Binary large object )

查看:195
本文介绍了如何在BLOB(二进制大对象)中的SQL数据库中存储整数数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在SQL数据库的blob中存储一个1000个值的整数数组。


我会每隔10秒执行一次。


我该怎么做????


什么数据类型必须使用???

谢谢

任何帮助

Peter

解决方案

最好的方法是在数据库中使用图像类型(给你2gb)

datastorage)。


之后..使用BinaryFormatter将数组序列化为二进制

可保存格式...


插入blob ...


为什么你想要使用blob会让我感到困惑,但对于他自己的每一个...... />
" Peter Stojkovic" < Pe的************* @ gmx.net>在留言中写道

news:e0 ************** @ TK2MSFTNGP09.phx.gbl ...

我想存储一个整数在SQL数据库的blob中有1000个值的数组。

我会每隔10秒执行一次。

我该怎么做???? >
什么数据类型必须使用???

感谢
任何帮助
Peter



CJ,

如果它总是一个整数数组。我会考虑使用System.Buffer来将
块复制整数数组到&来自一系列字节。


当然BinaryFormatter更灵活。


希望这有帮助

Jay


" CJ Taylor" < [cege] at [tavayn] dit commmmm>写在消息

新闻:uJ ************** @ TK2MSFTNGP12.phx.gbl ...

最好的方法是在数据库中使用图像类型(为您提供2GB的数据存储)。

之后..使用BinaryFormatter将数组序列化为二进制
可保存的格式......

插入blob ......

为什么你想要使用blob会让我感到困惑,但对于他自己的每一个......

" Peter斯托伊科" < Pe的************* @ gmx.net>在消息中写道
新闻:e0 ************** @ TK2MSFTNGP09.phx.gbl ...

我想存储整数数组1000
SQL数据库中blob中的值。
我将每隔10秒执行一次。

我该怎么做????
什么数据类型必须使用???

感谢
任何帮助
彼得



嘿Jay,


我不知道那个。我只是想用最快/最少的b $ b来解决这个问题。 =)


我不知道他们为什么要这样做,但我*假设*(小心!)它的

因为他想要在某种程度上保持坚持......


再次,我可能是错的。


-CJ


Jay B. Harlow [MVP - Outlook]" < JA ************ @ msn.com>在消息中写道

news:ue **************** @ tk2msftngp13.phx.gbl ...

CJ,
如果它总是一个Integer数组。我会考虑使用System.Buffer将整数数组块复制到&来自一系列Bytes。

当然BinaryFormatter更灵活。

希望这有帮助
Jay

CJ Taylor ; < [cege] at [tavayn] dit commmmm>在消息中写道
新闻:uJ ************** @ TK2MSFTNGP12.phx.gbl ...

最好的方法是使用图像类型在你的数据库中(给你2GB的
数据存储)。

之后..使用BinaryFormatter将数组序列化为二进制
可保存格式......
<插入blob ......

为什么你想要使用blob会让我感到困惑,但对于他自己的每一个......

" Peter Stojkovic" < Pe的************* @ gmx.net>在消息中写道
新闻:e0 ************** @ TK2MSFTNGP09.phx.gbl ...

我想存储整数数组1000 SQL数据库中blob中的值。
我将每隔10秒执行一次。

我该怎么做????

什么数据类型a必须使用???

感谢
任何帮助
Peter





I want store an integer-array of 1000 Values in a blob in a SQL-database.

I will do this every 10 Seconds.

How can I do this ????

What datatypes a have to use ???
Thanks
for any help
Peter

解决方案

The best way is to use an image type in your database (gives you 2gb of
datastorage).

After that.. use a BinaryFormatter to serialize the array to binary
saveable format...

Insert into blob...

why you wnat to use a blob confuses me, but to each his own...
"Peter Stojkovic" <Pe*************@gmx.net> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...

I want store an integer-array of 1000 Values in a blob in a SQL-database.

I will do this every 10 Seconds.

How can I do this ????

What datatypes a have to use ???
Thanks
for any help
Peter



CJ,
If its always an Integer array. I would consider using System.Buffer to
block copy the integer array to & from an array of Bytes.

Of course the BinaryFormatter is more flexible.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...

The best way is to use an image type in your database (gives you 2gb of
datastorage).

After that.. use a BinaryFormatter to serialize the array to binary
saveable format...

Insert into blob...

why you wnat to use a blob confuses me, but to each his own...
"Peter Stojkovic" <Pe*************@gmx.net> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...

I want store an integer-array of 1000 Values in a blob in a SQL-database.
I will do this every 10 Seconds.

How can I do this ????

What datatypes a have to use ???
Thanks
for any help
Peter




Hey Jay,

Didn''t know about that one. I was just going with the fastest/least
confusing way I could think of doing it with. =)

I have no idea why they want to do it, but I''m *assuming* (beware!) its
because he wants to maintain persistance in some way..

then again, I could be wrong.

-CJ

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:ue****************@tk2msftngp13.phx.gbl...

CJ,
If its always an Integer array. I would consider using System.Buffer to
block copy the integer array to & from an array of Bytes.

Of course the BinaryFormatter is more flexible.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...

The best way is to use an image type in your database (gives you 2gb of
datastorage).

After that.. use a BinaryFormatter to serialize the array to binary
saveable format...

Insert into blob...

why you wnat to use a blob confuses me, but to each his own...
"Peter Stojkovic" <Pe*************@gmx.net> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...

I want store an integer-array of 1000 Values in a blob in a SQL-database.
I will do this every 10 Seconds.

How can I do this ????

What datatypes a have to use ???
Thanks
for any help
Peter





这篇关于如何在BLOB(二进制大对象)中的SQL数据库中存储整数数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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