Unanswered: 1st year IT student - HELP with concept
I'm a first year IT student from Serbia and this is my first time i'm working with databases so I was wondering if I could get your help.
I can't visualise how to connect the databases so I need help with the concept not the implementation and creating the databases.
So we're working with C# in the .NET 3.5 framework and we need to complete a program which will be used by professors and students. The program should comprise of 2 databases (Students and Professors) and will have addition two tables (Grades and Subject).
The students will have the option to submit an application to take the exam, whereas the professors will have an option to upload the grades of the exam and show the results.
I'm not entirely sure what your question I think this is the info you are looking for:
1) Choose your database environment (MS SQL Server and MySQL are two obvious choices for .NET development)
2) Install / Reference the appropriate database interface libraries for the database server you've chosen. The libraries for MS SQL are built in, I'm sure the MySQL ones (as well as Oracle, etc.) are easy to find.
3) There are a ton of different coding styles for mixing your procedural code with your SQL code. One basic way is to create functions that act as intermediaries between C# & SQL, i.e.:
public bool UpdateGrade(int StudentID, double Grade)
string sql = "UPDATE grades SET Grade = " + Grade + " WHERE StudentID = " + StudentID;
//Code to initialize database object
//Code to execute SQL
//Code to check that update occurred and return true / false.
A few additional notes:
1) I don't see much of a reason to separate your Students / Professors databases. I assume there will be some data that will be needed by both sides and you're only creating additional work for yourself. Assuming your application is well built and so is your security, you don't have to worry about students accessing professors records.
2) Most SQL interface libraries offer functions to build your query that protect against SQL injection attacks. Do some research regarding best practices surrounding this.