[Help](5165)

02/10/2011 17:40 coreymills#1
i know i'm annoying

Quote:
MySql.Data.Types.MySqlConversionException: Unable to convert MySQL date/time value to System.DateTime
at MySql.Data.Types.MySqlDateTime.GetDateTime()
at MySql.Data.MySqlClient.MySqlDataReader.GetValue(In t32 i)
at MySql.Data.MySqlClient.MySqlDataReader.GetValues(O bject[] values)
at System.Data.ProviderBase.DataReaderContainer.Commo nLanguageSubsetDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.SchemaMapping.LoadDataRow ()
at System.Data.Common.DataAdapter.FillLoadDataRow(Sch emaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(Data Set 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(Data Set 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)
at ConquerSx.Database.MySqlReader.TryFill(MySqlComman d command) in C:\Users\Mills\Documents\Corey\Sources\source\sour ce\Database\MySqlReader.cs:line 46
Line: 46
Code:
DataAdapter.Fill(_dataset, Table);
02/10/2011 17:49 Syst3m_W1z4rd#2
I can only recommend you another source.
02/10/2011 18:02 coreymills#3
lol the only mysql source i can get to work is the conquersx cause the download for impulses source was removed(download Link)
02/10/2011 18:56 Spirited42#4
Yikes. I hate Conquer SX.
Well.... somewhere your source is trying to read a DateTime by converting something and it's not working. Use breakpoints as your server loads / when you log in to figure it out.
02/10/2011 18:58 Syst3m_W1z4rd#5
Omfg..... There is like 20download links on the first page of impulse source.

What is line 46?
02/10/2011 19:06 Spirited42#6
Quote:
Originally Posted by Syst3m_W1z4rd View Post
Omfg..... There is like 20download links on the first page of impulse source.

What is line 46?
If it's like the errors I used to get when I didn't name a table correctly for reading, it's just the reader messing up saying it can't do it. He needs to figure out where that came from with breakpoints.
02/10/2011 23:44 stealarcher#7
haha, this is actually my source im using. And im not sure exactly what the error is, but it doesnt affect anything. What caused this error was when i put in the custom temporary ban system, and it fetches their datetime from mysql and reads it as a string from mysql, then in C# i convert that string into a datetime using Convert.ToDateTime(string); It reads that date time just fine, i have dumped it out and read the values to check, but I still get that error. Not a big deal but kinda annoying.
02/11/2011 00:06 _DreadNought_#8
Yes I know your error I experienced it a while back. The string your saving needs reversing. My Jail timer class which will save in the correct format
Code:
public static void PutInJail(Client.GameState client, string _For, int _Minutes, int _Hours, int _Days)
        {
            //YY-MM-DD HH:MM:SS
            //DateTime _DT = DateTime.Now;
[B]            string Year = Convert.ToString(DateTime.Now.Year);
            string Month = Convert.ToString(DateTime.Now.Month);
            string Day = Convert.ToString(DateTime.Now.Day);
            string Hour = Convert.ToString(DateTime.Now.Hour);
            string Minute = Convert.ToString(DateTime.Now.Minute);
            string Second = Convert.ToString(DateTime.Now.Second);[/B]
            uint _UID = client.Entity.UID;

            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT)
                .Select("jail");
                cmd.Insert("EntityUID", _UID)
[B]                .Insert("ArrestedAt", Year + "-" + Month + "-" + Day + " " + Hour + ":" + Minute + ":" + Second)[/B]
                .Insert("Minutes", _Minutes)
                .Insert("Hours", _Hours)
                .Insert("Days", _Days)
                .Insert("ArrestedFor", _For)
                .Execute();
        }
Lines in bold are what you need.
02/11/2011 00:38 stealarcher#9
#problem resolved. Corey msg me on msn. For those curious, oddly enough it was with the mysql reader reading a table with timestamps without even assigning the timestamp to anything or reading it.