0

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 !

1
  • 6
    Umm. 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. Commented Nov 30, 2011 at 3:39

1 Answer 1

1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.