.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

getting Error Message:Exception of type 'System.OutOfMemoryException'

Posted By: kamlesh     Posted Date: May 26, 2011    Points:5   Category :C#
Error Message:Exception of type 'System.OutOfMemoryException' was thrown. ,Stack Trace: at System.Data.SqlClient.TdsParser.ReadPlpUnicodeChars(Char[]& buff, Int32 offst, Int32 len, TdsParserStateObject stateObj)
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(DataTable[] dataTables, 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(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at OutlookDemo.MailService.GetMailDetailBySubNode(Int32 SubFolderId, String Filter)


Please Help me

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: May 26, 2011     Points: 20   

Hi,
Seems like your program is running infinite loop somewhere.

Could you please post your code.

For more info http://support.microsoft.com/kb/825680

Author: Maverick             
Posted Date: May 27, 2011     Points: 20   

Hello,

Can you please post your code. So that we can make out the bug.

Thanks,
Maverick
Author: kamlesh             
Posted Date: May 27, 2011     Points: 20   

SqlDataAdapter da = new SqlDataAdapter(sqlCmd);
DataTable dt = new DataTable();
da.Fill(dt); ................ here i get the Exception
for (int i = 0; i < dt.Rows.Count; i++)
{
MailDetailDTO MailDetail = new MailDetailDTO();
MailDetail.ID = Convert.ToInt32(dt.Rows[i]["ID"]);
MailDetail.Name= Convert.ToInt32(dt.Rows[i]["Name"]);
MailDetail.From = Convert.ToInt32(dt.Rows[i]["From"]);
MailDetail.To = Convert.ToInt32(dt.Rows[i]["To"]);
MailDetail.Body= Convert.ToInt32(dt.Rows[i]["Body"]);
MailList.Add(MailDetail);
}
Close Connection
and return the Maillist and this mailList will show me in Datagrid View

suppose their are 10000 records in my database and in Body thier are some unicode present and i want to show that in grid view.
please Help me.

Thanks And Regards.
Kamlesh Nikam


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend