[Help] PServer Console

09/15/2009 03:28 Jay1029#1
K, a lot of the things my console tells me I do not understand. I try! Don't get me wrong. I know a lot more then I used to. But this one got by me...I have no clue what it means. It appears as soon as ANYONE (except myself) logs in.

System.InvalidOperationException: Connection must be valid and open
at MySQL.data.MySQLClient.MySQLCommand.CheckState<>
at MySQL.data.MySQLClient.MySQLCommand.ExecuteNonQuer y<>
at COServer_Project.Database.SaveHB<Character Charr> in D:\Documents and Settings\******\Desktop\Pyro Source\Source\COServerProject\database.cs:line 1169


I thought I had an idea of what it could have been but I was wrong =\ I still got the error. What I did was take "Points" out of SaveHB so it wouldn't save them there (It never did anyways -.-') but it failed =\
Now I need help =p
09/15/2009 04:23 .Guru#2
i admire your persistence in learning c# very much. you for one, unlike *cough* blade *cough*, persist at it, so i'll be glad to try to help ya out.

kk, first: SaveHB -- what's it saving? if i were you i would just make the SaveMyChar or w/e, saving everything in you Char Table.

instead of having it save both your char & points with a different timer (or w/e it's saving off of).

Goto your .cs that the error is in, copy the whole line & post it here.
09/15/2009 04:45 danielachraf#3
Quote:
D:\Documents and Settings\******\Desktop\Pyro Source\Source\COServe rProject\database.cs:line 1169
can't you read?
09/15/2009 04:48 taylor2846#4
Quote:
Originally Posted by danielachraf View Post
can't you read?
why say can't you read if he is only this post you no he can read .. just tell him to read the earror it says it there and help him undersand what the earror is saying "can't you read?" how can that help any one?
09/15/2009 23:03 Jay1029#5
When I go to the error in my source it brings me here

Code:
        public static void SaveHB(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `HeavenBless` = '" + Charr.HBEnd.ToString() + "',`WhichBless` = '" + Charr.WhichBless + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
Command.ExecuteNonQuery(); is the actual line where I am getting the error.
It's so confusing just because I don't know what is causing the error.
09/16/2009 00:07 .Guru#6
Quote:
Originally Posted by Jay1029 View Post
When I go to the error in my source it brings me here

Code:
        public static void SaveHB(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `HeavenBless` = '" + Charr.HBEnd.ToString() + "',`WhichBless` = '" + Charr.WhichBless + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
Command.ExecuteNonQuery(); is the actual line where I am getting the error.
It's so confusing just because I don't know what is causing the error.
is HB in your database?
09/16/2009 00:09 _tao4229_#7
How is this confusing??!?!?!
'System.InvalidOperationException: Connection must be valid and open'
Can you not read plain and flat english?!!?!?!
09/20/2009 04:33 Jay1029#8
@tao4229
Yeah, sorry I actually have a life so I can't learn this sh*t 24/7 like yourself. Well you probably have everything memorized. Anyways.."'System.InvalidOperationException:"
Wtf does that mean...Your answer was the most retarded thing I'd seen all day. What was the f*cking point in replying. If you were going to take the time of day to type that you might as well have typed something useful.
09/20/2009 04:51 _tao4229_#9
Quote:
Originally Posted by Jay1029 View Post
@tao4229
Yeah, sorry I actually have a life so I can't learn this sh*t 24/7 like yourself. Well you probably have everything memorized. Anyways.."'System.InvalidOperationException:"
Wtf does that mean...Your answer was the most retarded thing I'd seen all day. What was the f*cking point in replying. If you were going to take the time of day to type that you might as well have typed something useful.
"Connection must be valid and open."
This is telling you that your connection is either not valid, or not open.
This means you should find what's causing the connection to be closed or invalidated.
Your turn, ignorant idiot.
09/20/2009 20:36 dsSharkk#10
You are retarded!! Thats not even what hes saying. He doesn't understand what "'System.InvalidOperationException:" means you idiot. You are blind or something? Two times you misread what he said so go take English lessons you illiterate son of a bitch.
09/20/2009 20:42 kinshi88#11
Quote:
Originally Posted by Jay1029 View Post
@tao4229
Yeah, sorry I actually have a life so I can't learn this sh*t
Then why the hell are you here? Making a server?
09/20/2009 20:48 Zion~#12
That's one of the stupidest things I've ever heard.
I think learning things is making something of your life, also only a complete noob coder will have to sit in front of the computer all day trying to code something.

#Poor argument.
09/22/2009 02:21 Jay1029#13
@tao4229
Roflz! You just got owned.

@dsSharkk
Respect bro lol.

@Zion~
Well according to kinshi apparently making a server means you have no life.

@kinshi
Umm..Why don't you try quoting the whole sentence. "Yeah, sorry I actually have a life so I can't learn this sh*t 24/7 like you"
I still learn when I have time. I'm pretty sure you can make a server and have a life at the same time. I have a job, go to school, play hockey etc..I don't need to explain myself.
09/22/2009 03:58 samehvan#14
Quote:
Originally Posted by Jay1029 View Post
K, a lot of the things my console tells me I do not understand. I try! Don't get me wrong. I know a lot more then I used to. But this one got by me...I have no clue what it means. It appears as soon as ANYONE (except myself) logs in.

System.InvalidOperationException: Connection must be valid and open
at MySQL.data.MySQLClient.MySQLCommand.CheckState<>
at MySQL.data.MySQLClient.MySQLCommand.ExecuteNonQuer y<>
at COServer_Project.Database.SaveHB<Character Charr> in D:\Documents and Settings\******\Desktop\Pyro Source\Source\COServerProject\database.cs:line 1169


I thought I had an idea of what it could have been but I was wrong =\ I still got the error. What I did was take "Points" out of SaveHB so it wouldn't save them there (It never did anyways -.-') but it failed =\
Now I need help =p
You said the error doesn't appear for u that means it works , and if u r sure that the source is saving all other players attributes then the only wrong thing i can figure out is u forgot to close the last connection :p
Code:
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `HeavenBless` = '" + Charr.HBEnd.ToString() + "',`WhichBless` = '" + Charr.WhichBless + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();
                Command.Connection.Close();
                Command.Connection.Dispose();
                Command.Dispose();
09/22/2009 04:09 _tao4229_#15
Quote:
Originally Posted by dsSharkk View Post
You are retarded!! Thats not even what hes saying. He doesn't understand what "'System.InvalidOperationException:" means you idiot. You are blind or something? Two times you misread what he said so go take English lessons you illiterate son of a bitch.
If you can't understand that the "System.InvalidOperationException:" is REFERRING to the next fucking statement you're the one who needs to take English lessons.