OdbcDatareader和4D ODBC驱动程序之间的伪文本数据长度. [英] Falsh text data length between OdbcDatareader and 4D ODBC driver.

查看:78
本文介绍了OdbcDatareader和4D ODBC驱动程序之间的伪文本数据长度.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在呆了一段时间,要通过Visual Studio 2005,C#和OdbcDatareader创建的客户端从TEXT类型字段中从4D SQL Server v11.5获取正确的文本数据.

I'm stuck a time now to get the right text data from an 4D SQL Server v11.5 from a TEXT type field via a client created with visual Studio 2005 and C# and OdbcDatareader.

问题是:

如果4D SQL Server上的字段具有超过2046个字符,则到达我的客户端的文本(在Visual Studio 2005中)具有2046个字符重复块的结构,并且每个块始终包含文本字段中的前2046个字符(其余字符将被忽略.)
仅当我尝试从4D读取数据时才会发生这种复杂情况.
如果我尝试将SQL Server 2005中的文本写到"TEXT"文件中在4D上,所有文本都是正确的,而与文本的长度无关.

If the Field on the 4D SQL Server has more than 2046 Characters then the text arrived on my client(in visual studio 2005) has the strukture of 2046 Character repeated blocks and each block contains allways the first 2046 characters from textfield (the rest characters are ignored).
This complication occurs only as i try to read the data from 4D.
If I try to write text from an SQL Server 2005 to a 'TEXT' filed on 4D all the text is wrtten correct independent from its length.   

使用OdbcDataReader对象访问数据.值得一说的是,如果我使用GetSchemaTable OdbcDataReader方法尝试Shema数据,
4D中的类型标识为System.String,长度为256,来自OdbcDataReader对象(假冒身份吗?).
我可以更改该方式吗? OdbcDataReader是否可以识别类型?

Im accesing the data with the OdbcDataReader Object. Worth to say is that if I try the shema data with the GetSchemaTable OdbcDataReader method,
all "TEXT" types in 4D identified as System.String with a length of 256 from  OdbcDataReader Object(false idendification?).
Can I change the way that  OdbcDataReader idendifies the types?

但是回到我的环境和参数.

But back to my enviroment and parameters.

Visual Studio:
通过odbcConnection连接字符串="DRIVER = {4D v11 ODBC驱动程序};说明= {4D v11 SQL数据源.};服务器= xxx.xxx.xxx.xxx;端口= 1919; UID = x; pwd = y; SSL = false; PhysicalConnectionTimeout = 30; LoginTimeout = 30; QueryTimeout = 240; DefaultPageSize = 100; NetworkCacheSize = 128; CharsEncoding = UTF-8'';使用OdbcDataReader

Windows XP:  Win XP,双核. 4D ODBC版本:11.04.02.00

我已经尝试过的步骤:

OdbcDataadapter和数据集.
与我的客户端不同的窗口功能(xp或7).
使用excel连接并获取数据.在这种情况下,Excel会从4D文本"字段中获取浏览器字符,但根本没有重复的块.
这个陡峭区域会产生相同的错误结果.

我也尝试过Network Protokol Analyzer,以显示来自ODBC驱动程序的数据查询.文本字符在那里是完整的,并且不会通过网络通信被发送出去.


好像OdbcDatareader不能正确地处理缓冲区?

Visual Studio:
Connectin string via odbcConnection = "DRIVER={4D v11 ODBC Driver};Description={4D v11 SQL datasource.};Server=xxx.xxx.xxx.xxx;Port=1919;UID=x;pwd=y;SSL=false;PhysicalConnectionTimeout=30;LoginTimeout=30;QueryTimeout=240;DefaultPageSize=100;NetworkCacheSize=128;CharsEncoding=UTF-8" with OdbcDataReader

windows XP:  Win XP, Dual Core. 4D ODBC Version: 11.04.02.00

Steps I have already tried:

OdbcDataadapter and dataset.
Diferent window maschines (xp or 7) with my client.
Connect and get the data with excel. Excel gets in this case mutch viewer characters from the 4D 'TEXT' field but there are not repeated blocks at all.
This steeps have the same wrong result.

I tried also a Network Protokol Analyser to show the data interrogate from the ODBC driver. The Text Character are complete there and not Cuted out over the network communication.


It seems as if OdbcDatareader don`t handle the buffer in the right direction?

我非常感谢每一个反馈.

I'm very appreciate of every feedback.

推荐答案

所以您只需要削减2046个字符?
so you need to cut just 2046 chars of field?


这篇关于OdbcDatareader和4D ODBC驱动程序之间的伪文本数据长度.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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