Click here to Skip to main content
12,291,230 members (65,953 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# .NET MySQL
Dear guys,
I have a small prob when trying to load datareader object into datatable
special if the object of datareader have column of LONGTEXT DataType "am use mysql database"
when convert datatype to "Text" the problem is solved,
My questions :
1- what's the difference between LONGTEXT and TEXT?
2- how to fix this problem without convert the datatype to TEXT?

The Error Message at DataTable.GetErrors() is "Column 'photo_file' exceeds the MaxLength limit."
Posted 14-Nov-12 3:07am
Comments
digimanus 14-Nov-12 9:12am
   
The error says it. ou have a LONGText block. The size of that object is larger than a string value can hold. Like trying to parse a 64bit int in a 32 bit. After some number this fails
Ahmad Abou Hamdh 14-Nov-12 14:59pm
   
no my friend cause the text length not more than 10 characters
digimanus 16-Nov-12 4:13am
   
then cast the field in the qery as Text
Kschuler 14-Nov-12 12:33pm
   
To get more detailed help, please click the Improve Question link and add the relevant code to your question. This will help us understand more about your problem.
Killzone DeathMan 26-Nov-12 11:24am
   
Just do not use a DataReader...
Use a DataAdapter and a DataSet...
Something like:

MySQLConnection conn = new MySQLConnection(connectionstring);
DataAdapter adapter = new DataAdapter("SELECT * FROM TEST", conn);
DataSet ds = new DataSet();
adapter.Fill(ds);
DataTable table = ds[0];

I am not sure, but you must download the mysql connector...
Regards,
KZ

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160518.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100