I need to use a database in my xna 4.0 game that will save data such as username, etc. can you give me an example on how to connect to a MySQL database and as well as an insert statement. thank you !
-
6Umm. you want an example of an insert statement? Is it really that hard to google up some SQL syntax examples? We can help fix problems with your existing code here, but we're not here to teach you something you could very easily learn yourself.Marc B– Marc B2011-11-30 03:39:45 +00:00Commented Nov 30, 2011 at 3:39
Add a comment
|
1 Answer
Here is a walk through and wrapper class for mysql in c#. http://iseesharp.blogspot.com/2005/09/mysql-with-c.html
Usage:
DbWrapper myWrapper = new DbWrapper("localhost", "CS",
"iseesharp", "seesharper");
myWrapper.Connect();
myWrapper.AddUser("Rowan", "ISeeSharp");
if (myWrapper.UserExists("rowan"))
{
Console.WriteLine("Something's weird here");
}
else
if (myWrapper.UserExists("Rowan"))
{
Console.WriteLine("I exist, therefore I think!");
}
myWrapper.Disconnect();