'System.OutOfMemoryException'填充数据适配器 [英] 'System.OutOfMemoryException' to fill the dataadapter

查看:70
本文介绍了'System.OutOfMemoryException'填充数据适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用dataadapter&从SQL表读取数据.
在该表中,在读取数据以填充数据适配器时一次仅从表中读取一行,它作为

i have fill the dataset using dataadapter & reading the data from the SQL table .
in this read only one row at time from the table when reading data to fill the dataadapter it thrown exception as

''System.OutOfMemoryException''


引发了异常



at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
  at System.Text.EncodingNLS.GetString(Byte[] bytes, Int32 index, Int32 count)
  at System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32 length, Encoding encoding, Boolean isPlp)
  at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
  at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
  at System.Data.SqlClient.SqlDataReader.ReadColumnData()
  at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
  at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
  at System.Data.SqlClient.SqlDataReader.GetValues(Object[] values)
  at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
  at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
  at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
  at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
  at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
  at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)



我在表的varchar字段中添加了170kb的数据.



在此先感谢



i have wtite the 170kb data in varchar field in table .



thanks in advance

推荐答案

vrushali,

只需参考以下链接.....

http://stackoverflow.com/questions/5092510/system-outofmemoryexception-when-filling-dataadapter [ ^ ]

http://www.dotnetspider.com/forum/234222-System- OutOfMemoryException-thrown-case-huge-data.aspx [ ^ ]
Hi vrushali,

Just refer Following Links.....

http://stackoverflow.com/questions/5092510/system-outofmemoryexception-when-filling-dataadapter[^]

http://www.dotnetspider.com/forum/234222-System-OutOfMemoryException-thrown-case-huge-data.aspx[^]


这篇关于'System.OutOfMemoryException'填充数据适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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