Is it possible to use an SQL database as a backend to an XNA game

The idea is to have an sql database on a server that can be accessed through connection code in the game to retreive and save data.

Is it possible with windows-only games

Is it possible with xbox games

Is there sample code somewhere

How does io work in XNA

Re: XNA Framework SQL Database Access

Glenn Wilson

Yes it can be done, but only for windows games. I have actually been doing this for a while but with MDX Games and soon to be with XNA Windows Games. If you do want to use some sort of database system on the Xbox you would need to use XML or write a custom solution.

Re: XNA Framework SQL Database Access

Jon Watte

X-box Live! is not exposed to the XNA libraries, and the System.Net namespace (and similar) are not available on the X-box, so you cannot do anything networked on that platform right now.

For a Windows game, you can use system sockets, TCPClients, and other networking from the .NET 2.0 framework, by just adding the reference and using the API. In that sense, writing a networked XNA game is no different from writing a networked Managed DirectX game.

Re: XNA Framework SQL Database Access


Thanks for your replies. So for Windows games I'm all set the way XNA works now; that's what I really want to do anyway. I've done plenty of database access via web sites, winforms projects, etc. using ado.net butI haven't used Windows sockets before but here goes!