help deleting character from 5165?

03/06/2012 06:56 joshuamns#1
public static void DeleteCharacter(string Name)
{
File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr");
MySqlCommand Cmd = new MySqlCommand("UPDATE accounts SET EntityName = '' WHERE EntityName = '" + Name + "'", DatabaseConnection.Connection);
Cmd.ExecuteNonQuery();
}

Is the code. "The name 'DatabaseConnection' does not exist in the current context."
any help would be appreciated :D
03/06/2012 08:32 Spirited#2
If the character data is being saved to a file, why is your account data being saved to MySQL? Are you using files for your accounts or MySQL? (NewestCoServer doesn't use MySQL, but you didn't specify what source you're using).
03/06/2012 20:16 diedwarrior#3
File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr"), obviously he's not using mysql....
03/06/2012 20:23 Spirited#4
Quote:
Originally Posted by diedwarrior View Post
File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr"), obviously he's not using mysql....
That's completely unrelated. Character data != account data.
03/06/2012 20:28 Nyorai#5
Fang sorry for the off-topic reply but, could you please check my thread?
I'm having some trouble figuring it out
03/06/2012 20:32 joshuamns#6
im not using Mysql (i tried to follow [Only registered and activated users can see links. Click Here To Register...] this. but as ive said im having a problem :p um. the source im using is from here [Only registered and activated users can see links. Click Here To Register...]
03/07/2012 00:06 Lateralus#7
Quote:
Originally Posted by joshuamns View Post
im not using Mysql (i tried to follow [Only registered and activated users can see links. Click Here To Register...] this. but as ive said im having a problem :p um. the source im using is from here [Only registered and activated users can see links. Click Here To Register...]
If you're not using MySQL, then why are you attempting to send MySQL commands?
03/07/2012 00:12 Spirited#8
Quote:
Originally Posted by Lateralus View Post
If you're not using MySQL, then why are you attempting to send MySQL commands?
^
Exactly.

Just take out the mysql command and make sure that you're updating the account file as well. There's more to this but... oh well. Basic functionality is still functionality.
03/07/2012 02:21 U2_Caparzo#9
look like he copied the code from another source with mysql
for delete char u just need what u have
File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr");
03/07/2012 02:27 injection illusion logic#10
lmao the other source is using a mysql database not a ini/txt , btw i guess u want to delete a single char not all of them , right ? else u was to delete the file manually o-0
well here where u got it from
Quote:
public static void DeleteCharacter(string Name)
{
File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr");
MySqlCommand Cmd = new MySqlCommand("UPDATE accounts SET EntityName = '' WHERE EntityName = '" + Name + "'", DatabaseConnection.Connection);
Cmd.ExecuteNonQuery();
}
Quote:
if(File.Exist(@"C:\OldCODB\Users\Characters\" + Name + ".chr"))
iunno what is this about , well the second quote is a check if that file exist
and the first part from first quote delete a file (which i guess contains char(s))
and second part updated the mysql accounts list
weirdo , should made both in mysql database
anyway
Quote:
Is the code. "The name 'DatabaseConnection' does not exist in the current context.
do u miss a reference (do u miss adding a dll as reference ?)
or u r not using mysql at all ?
lol i still cant figure out what's wrong , im shooting in dark but yeah that will never work till u have 2 files one txt got char and one mysql got accounts -.-
03/07/2012 06:48 joshuamns#11
nah im not using mysql lol. and ive tried without the mysql command like some people have suggested and still no luck. same problem
03/07/2012 06:50 Spirited#12
Quote:
Originally Posted by joshuamns View Post
nah im not using mysql lol. and ive tried without the mysql command like some people have suggested and still no luck. same problem
If you remove it, how are you getting the same problem? Do you have a screenshot of the error message? Are you building the project?
03/07/2012 07:57 joshuamns#13
i have no idea how im getting the problem still. and tomorrow afternoon i'll take a screeny of it. (and it wont let me build it because of the error)
i dont think it would matter if im using Visual Studio 11 Beta does it?

nvm i got it thanks :D somehow one of the lines got pasted more than once >.< i feel like an idiot haha.
03/07/2012 14:54 injection illusion logic#14
omg lol
03/08/2012 00:32 U2_Caparzo#15
Quote:
Originally Posted by injection illusion logic View Post
lmao the other source is using a mysql database not a ini/txt , btw i guess u want to delete a single char not all of them , right ? else u was to delete the file manually o-0
well here where u got it from

do u miss a reference (do u miss adding a dll as reference ?)
or u r not using mysql at all ?
lol i still cant figure out what's wrong , im shooting in dark but yeah that will never work till u have 2 files one txt got char and one mysql got accounts -.-
just a NCOs source, with a code copied and pasted from a... hmmm maybe trinity source or any impulse updated so he dont have the file or dll called DatabaseConnection...