-2

I soon have to start a project that takes that I'll create a program allowing a user to create a server for a game I'm building. The server program will, in addition to other things I'm working on, have to update player's information onto the Microsoft SQL Server 2008. I am using System.Data & System.Data.SqlClient on the form, but I don't know if everyone will have the SqlClient on their computer and I don't want to have troubles later.

Should I somehow add the SqlClient dll to the main folder? I used that on one of my WinForms before. However, if yes, please also tell me where to find the DLL file of System.Data.SqlClient. I found System.Data but not the SqlClient dll

Kfir Eichenblat
  • 449
  • 2
  • 8
  • 27
  • 2
    If the server program is seperate to the client, then the client won't need sql. It should be communicating with the server. Is the server running on their machine? which SQL Server is the server using then? Besides all that I think System.Data is part of the .Net framework which they'll need to run the c# app in the first place. SqlClient is in the System.Data dll (SqlClient is the namespace, not the assembly name) – James Apr 16 '13 at 09:18
  • Server is running on a client's machine. He just chooses to create a new server, it could be any player. SQL Server used, as said, Microsoft SQL Server 2008. I believe you're right about the SqlClient. I will have to send it to multiple people first to see how goes. However the Client itself is an **XNA** game and I will have to see if SqlClient works there too, as I may need the player connected to the database too – Kfir Eichenblat Apr 16 '13 at 09:27
  • I would try to focus on the server being responsible for the database, it keeps the client cleaner. I don't think you should worry about the user having the System.Data dll. Especially since the server requires SQL Server 2008 which they are much less likely to have installed. You might want to try to find a lighter weight database solution that you can ship with your server. – James Apr 16 '13 at 09:34
  • @JamesB only that I need a way to update available servers for user. I also have a host on GoDaddy under simpleprods.com, I forgot to specify that. **However**, I thought using the database from the client for registration and available servers update. Do you know, maybe, how I can use my host to run a main server? (I know there are different kind of host plans but let's try to disregard that) – Kfir Eichenblat Apr 16 '13 at 09:53
  • @JamesB maybe a way around, is **somehow** to send commands to the website and make the website do database actions. I just don't know how to command a website from a Windows Form and couldn't find any information about it on the internet – Kfir Eichenblat Apr 16 '13 at 10:09
  • That's entirely possible but a little off topic for this question. Please ask it as a new question. – James Apr 16 '13 at 10:11

1 Answers1

1

System.Data.SqlClient is a namespace in the System.Data assembly.

In terms of your architecture. You'll need a host which provides a SQL Server instance, but you can provide a web front-end which doesn't display nicely rendered html but provides a text stream reporting available server IP Addresses, you can also provide authentication for this. This way the client still doesn't need to access the DB directly. You can provided registration from the website or if you do need it on the client then you can submit a http post or alternative submission to your websiteand have the website register the client.

It is important to keep your actual data behind the layer of the website/server and use the inbuilt technologies to protect your clients data.

James
  • 9,774
  • 5
  • 34
  • 58
  • So you're saying I should use HTTP post to command my websites to do things such as register a user, or add a server to the available list? Also, how do I RETRIEVE data back from the website through the Windows Form? (Would highly appreciate if you have some guide for it) – Kfir Eichenblat Apr 16 '13 at 10:25
  • @Kfirprods, There are a number of ways to submit data to a website and retrieve information back again. You would be writing a web API. one method is using http post and replying with plain text instead of html. There are plenty of people here far more experienced than me with webAPI's. Start with a little research and come back and ask any question's you have as a new question. – James Apr 16 '13 at 10:37