[Question]Is it possbile to make 5165 load accs, ranks, characters From mysql ?

03/12/2010 23:37 Paralyzer[GM]#16
Thanks .Arco :D

+Thanks
03/12/2010 23:59 _Emme_#17
First of all you need to implement the MySql.Data.dll into the project (Add refference).

Then you need to set up an connection, don't know if you have a Database.cs, but somewhere where the data base is handled, do a new connection string.

You do this by using

Quote:
MySqlConnection connection;
You may need to make this public/static.

Then, you need a Connect function. Basically, this is just used to create a new MySqlConnection with the correct host,user and database (check other SQL sources for examples, this vary on your DB). Don't forget to open the connection.


Now, people suggested you to use the LOTF way, well don't.

Here's an example how another way works:



Quote:
MySqlCommand cmd = new MySqlCommand("SELECT * FROM `accounts`", connection) // Get all data from the accounts table

MySqlDataReader rdr = cmd.ExecuteReader();

while (rdr.Read()) // While it keeps reading
{

Console.WriteLine(rdr["Name"]); // Output the variablename value "Name" in the console

}

rdr.Close(); //Closes the reader

Good luck!
03/13/2010 00:29 Paralyzer[GM]#18
Thanks, but :S
03/13/2010 00:37 Korvacs#19
Just do a search on the net for MySQL in C#, i wouldnt bother listening to emme if i were you, hes not great at programming, and fails even more at explaining things.
03/13/2010 00:39 walmartboi#20
I converted EVERYTHING into MySQL in my source, without using anything as a guide.

@Paralyzer, Knowing you level of C# knowledge, just give up, it's way too advanced for you.(If you did it the way I did, however)
03/13/2010 00:41 Korvacs#21
Quote:
Originally Posted by walmartboi View Post
I converted EVERYTHING into MySQL in my source, without using anything as a guide.

@Paralyzer, Knowing you level of C# knowledge, just give up, it's way too advanced for you.(If you did it the way I did, however)
Im interested in what you did which you would class as advanced?
03/13/2010 00:48 Arcо#22
Quote:
Originally Posted by Korvacs View Post
Im interested in what you did which you would class as advanced?
Too advanced for HIM.(Paralyzer)
Not advanced in general.
03/13/2010 01:00 Paralyzer[GM]#23
Well I can code things, atm im conveting CTF to 5165 and just mysql converting is not my thing :(
03/13/2010 01:25 herekorvac#24
Quote:
Originally Posted by EmmeTheCoder View Post
First of all you need to implement the MySql.Data.dll into the project (Add refference).

Then you need to set up an connection, don't know if you have a Database.cs, but somewhere where the data base is handled, do a new connection string.

You do this by using



You may need to make this public/static.

Then, you need a Connect function. Basically, this is just used to create a new MySqlConnection with the correct host,user and database (check other SQL sources for examples, this vary on your DB). Don't forget to open the connection.


Now, people suggested you to use the LOTF way, well don't.

Here's an example how another way works:






Good luck!

stop giving him answers i told him what to do search on google for a mysql dll and try to do it himself!

Your just going to spoonfeed him? stop it. its stupid. emil you wont ever learn will you?
03/13/2010 01:25 herekorvac#25
dont convert it to 5165 make ur own :)
03/13/2010 02:29 262315610#26
Quote:
Originally Posted by Paralyzer[GM] View Post
Well I have been wondering this for a long but but I relise you need another .cs file I dono call it Connect.cs and ur gonna want the tables Characters, Accounts, Top archer, Top ko, Top Donations etc

But how would you do this ? change the method from biniary to save ? idk just asking for some help with this and I may try to do this.

I think the mysql work far more efficient than Binary Read / Write!
I thought changes 5165source working on MYSQL..
But so much code need modify ...

I try to modify some code, but there So much errors, the result, I lost the information on the 5165source!

I'm chinese , I hope that interested people and I get together, you must C # Professional!!
03/13/2010 11:40 _Emme_#27
Quote:
Originally Posted by Korvacs View Post
Just do a search on the net for MySQL in C#, i wouldnt bother listening to emme if i were you, hes not great at programming, and fails even more at explaining things.
"Okay". I'm not even going to bring the discussing to the table, but yeah none of you seen me code for over a year, and the way I showed on page 2 is a really good way to do it.

Btw, don't moderators support people helping? :)



@herekorvac
I'm not spoonfeeding him, that's helping, explaining to him every row in a good way to do MySQL queries, it's not like I'm giving him a copy-paste code.



peace
03/13/2010 11:59 Korvacs#28
Quote:
Originally Posted by EmmeTheCoder View Post
"Okay". I'm not even going to bring the discussing to the table, but yeah none of you seen me code for over a year, and the way I showed on page 2 is a really good way to do it.

Btw, don't moderators support people helping? :)

@herekorvac
I'm not spoonfeeding him, that's helping, explaining to him every row in a good way to do MySQL queries, it's not like I'm giving him a copy-paste code.

peace
Yeah we support people helping, not hindering, which what you tend to do.

SQL is something that changes from source to source and from use to use, youve demonstrated a bad way of doing 1 aspect of SQL, what happens if the connection is already active, or in use, or limited to 1 user, or it times out. You havent handled any of these.

You arnt using stored procedures either, so its going to be alot slower than it could be.

You are happy doing what your doing, no need for you to come back here emme.
03/13/2010 12:01 herekorvac#29
Quote:
Originally Posted by Korvacs View Post
Yeah we support people helping, not hindering, which what you tend to do.

SQL is something that changes from source to source and from use to use, youve demonstrated a bad way of doing 1 aspect of SQL, what happens if the connection is already active, or in use, or limited to 1 user, or it times out. You havent handled any of these.

You arnt using stored procedures either, so its going to be alot slower than it could be.

You are happy doing what your doing, no need for you to come back here emme.
korvacs luves me,
03/13/2010 13:02 KraHen#30
Quote:
Originally Posted by Paralyzer[GM] View Post
Well I can code things, atm im conveting CTF to 5165 and just mysql converting is not my thing :(
You should check the difference between coding and scripting. You`re not coding, you`re scripting. I think this helps, if not, then sorry.