Register for your free account! | Forgot your password?

You last visited: Today at 01:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Source database error

Discussion on Source database error within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
Source database error

hi, i was wondering if you guys can help me solve my problem.

But please explain me the problem a bit that the Consol is telling, i don't want you guys to tell me how to fix it, simply explain me a bit what its saying and i will do my best to fix my self



i know its about weapons, and i tested this error pop up every time i wear a weapon, other item are okay, sry i know the error is not that hard its just need someone to explain me the problem.

Code:
 public static string LoadItemString(uint ItemId, string Type)
        {
            using (var m_Conn = Connection)
            {
                try
                {
                    MySqlCommand Command = new MySqlCommand("SELECT " + Type + " FROM items WHERE ItemID='" + ItemId + "'", m_Conn);
                    using (MySqlDataReader rdr = Command.ExecuteReader())
                    {
                        if (rdr.Read())
                        {
                            return rdr[Type].ToString();
                        }
                    }
                    return "0";
                }
                catch (Exception e)
                {
                    FlatDatabase.WriteLine(e);
                    //Database.WriteLine("Failed To ReadItem {0}!", ItemId);
                    return "0";
                }
            }
        }
LordGragen. is offline  
Old 07/23/2013, 10:57   #2
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 705
The query that is being used is wrong.
turk55 is offline  
Thanks
1 User
Old 07/23/2013, 12:11   #3
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
i love when someone is telling me whats wrong and giving some advice XD making me to look at that code until i come up with something, ty

all i had to do is

change from

Code:
MySqlCommand Command = new MySqlCommand("SELECT " + Type + " FROM items WHERE ItemID='" + ItemId + "'", m_Conn);
to

Code:
MySqlCommand Command = new MySqlCommand("SELECT * FROM items WHERE ItemID='" + ItemId + "'", m_Conn);
LordGragen. is offline  
Old 07/23/2013, 12:43   #4

 
Arby's Avatar
 
elite*gold: 83
Join Date: May 2011
Posts: 11,029
Received Thanks: 6,036
#closed (requested)
Arby is offline  
Closed Thread


Similar Threads Similar Threads
MySql 5.1 Or Database Or Source
05/04/2012 - CO2 Private Server - 7 Replies
I Have Problem At My Server Just Happened From 3 Days the problem is Disconnect at my Server Can't login and Can't exit like i open FireWall at My Network i don't have any Error to know problem i'm Use MySql 5.1 For Database anyone know what this problem>?
Database.cs Error?
12/13/2009 - CO2 Private Server - 2 Replies
Well I get my friends playing my server and I'm getting this alot. This therefore isn't saving them. They also DC alot but maybe thats more to do with my conenction. http://img704.imageshack.us/img704/2858/error1n.p ng and inside line 1183 is the save char region. public static void SaveCharacter(Game.Character C, string Acc) { try { FileStream FS = new FileStream(@"C:\OldCODB\Users\Characters\&quo t; + C.Name + ".chr", FileMode.Open); ...
need npc database for shadeCO source
04/17/2009 - CO2 Private Server - 3 Replies
hey can anyone give me npc database for shade source using navicat. i need some more npc like prof god and others so if anyone knows pm me or my conquer site at conquer freaks - Main page. join my server if u want to



All times are GMT +1. The time now is 01:20.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.