Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Server - Client | Storing data on Server

Hey there guys.

I've finished reading a C# book but unfortunately, I haven't had the opportunity to experiment and practice with it so far.
That scares me off especially when it comes to making a 'server/client' app that I'm thinking of.

So, I've got an idea that I can use to make a quite simple, I guess, application that will be very useful on my job.
What I want to do is the following.

We have a main server that every other computer(local) connects to in order to share files while also have access to the SQL database.
I would like to create a simple database program, without having to make a new or edit the existing SQL database. Let's say I want to make my own database. Could this happen?

Image Example (Click to View)


I know that anyone who knows a bit of C# will laugh at me but well.
That is going to be my first ever project, something that I want to create and I will surely add more things to it when I manage to make it.

Could you guide me to the right direction of what should I look for?
Any kind of help will be appreciated!

Thanks!
https://hackforums.net/showthread.php?tid=5077328
https://github.com/gubed/LiteCode-Example
Assert failure(PID 10704 [0x000029d0], Thread: 10960 [0x2ad0]): pBuffer != NULL
This sounds pretty fun to do. Gonna tell you an easy way to do it.

For the connection you can use TCP, I think it's your best choice here.
You could use a library for the client and server. (e.g. this). Some cool libraries here on HF as well, just use something basic if you're not that experienced.

Quote:without having to make a new or edit the existing SQL database. Let's say I want to make my own database.
I am not quite sure what this means. Making your own database implies creating a database.

But it's not that hard to make a basic database, easier than you might think.
If you don't wanna go into details, create a Service-Based Database.
The database will be a file within your project and you can edit tables and others really easily using the Server Explorer.

After you got your database working and your tables ready, create a new item called ADO.NET Entity Data Model using the option Code First from Database and you are basically set.
You are going to see some classes added to your project:
  • a class for every table you have
  • the DbContext, having the name you chose during the Entity Model setup

Let's say for example you chose the name MyDbContext and you have a table called User which contains a Username and Password.
How do you add data to a table?

Code
private MyDbContext DB = new MyDbContext();

User newUser = new User();
newUser.Username = "testAccount";
newUser.Password = "testPassword";

DB.Users.Add(newUser); // If you chose to pluralize during the setup, 'User' will be turned into 'Users' for instance
DB.SaveChanges(); // Don't forget this

That's it. You can now check the data from the table using the Server Explorer ( Right-Click on table -> Show Table Data ) and you're gonna see the new user.

Now, for the server-client connection. If you are gonna use a library (which I recommend), you'll probably have events such as DataReceived for instance. Just hook that event up in the server app and then evaluate the data send by the client.

For instance, the server receives "register|testAccount|testPassword". The server evaluates the command and then the arguments by splitting the string into parts, then proceeds to register the specific account.
The client (usually) just sends data to the server, so that should be pretty straight forward to do.
I would strongly recommend that you take a look at WCF Windows Communication Foundation.
https://en.wikipedia.org/wiki/Windows_Co..._Foundatio it's relative easy to adapt to it.
Im going to be bias and suggest you use this networking library:
https://hackforums.net/showthread.php?tid=5506453

It has built in remote functions. And if its something you are going to market (using netseal licence system), this might also be of interest.
https://hackforums.net/showthread.php?tid=5530798
Lotta blood to let, peace to make, give a fuk about a check
(Jan 29, 2017 02:38 AM)zeroexp Wrote:  -snip-

Please die in hell. Doing this basically means storing credentials on software or let anybody do everything he wants to the database.

@OP: The only secure way to handle your needs is to create a REST service to handle every request done to the database.
So, you basically wants to do CRUD (Create, Read, Update and/or Delete) some record/s on a SQL table/tables in your job corp?

Has your job corp server a IIS? If yes, you can deploy a very simple ASP.NET intranet (intranet != internet) page that clients (clients = employers) could use for that CRUD using a standard WebBrowser like FIreFox, Chrome, IE. This can be done in less than 10 minutes.

If your job corp server hasn't IIS, you could develop a WinForms/WPF app that need to be install / run in every job corp employer PC. This app would CRUD on the job corp SQL Server. This can be done, literally in less than 5 minutes.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:02 AM 4 219 Sep 24, 2026 10:02 AM
Last Post: Anonynuk
[C#] by zxPhantomBladeNov 16, 2020 03:05 AM 4 199 Nov 16, 2020 03:05 AM
Last Post: zxPhantomBlade
[Python] by 4ground_daemonJan 13, 2019 11:34 PM 5 231 Jan 13, 2019 11:34 PM
Last Post: Asdethprime