Project of the subject of Accessing Data From Program Code of the Software Engineering degree at Algebra University College (Zagreb). The project consist in a replica of the SSMS (SQL Server Management Studio). The project is completely done in C# with the Form Window framework. Part of the code is done with the help of the Professor Daniel Bele.
The application has a SQL Server Authentication in order to use it. So it handle non registered users and so on.
Once the user has been aunthenticated so username and passwords are correct, then main screen will show:
- On the top three buttons:
- The first one is to see the content of the selected table or view.
- The second one is to save the selected table in an XML file.
- The third and last is to run a new query.
- On the left side there is a tree view of the tables, views and procedures in the Data Base.
- On the right side there is a text box where the procedures's code will be shown.
![image](https://private-user-images.githubusercontent.com/94635721/278709841-ce88cfc8-da58-40c8-a97e-7c1a1d9ade23.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NjQ5OTQsIm5iZiI6MTcyNDQ2NDY5NCwicGF0aCI6Ii85NDYzNTcyMS8yNzg3MDk4NDEtY2U4OGNmYzgtZGE1OC00MGM4LWE5N2UtN2MxYTFkOWFkZTIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDAxNTgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwYWRlZWJkNDBiYjA3Njk5ZWEyOGM5OGMyNjY4OTI4M2ZjNjAwOWJkM2FkNjk5MmQ4NTRiMThhZWMwMGEzYmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.08LsO1r04LGT6DvIHpuYaV55Z9j7PR6tbIdOdjxoHR4)
When the run button is clicked, automaticaly, the content of the selected table or view will be shown.
![image](https://private-user-images.githubusercontent.com/94635721/278711180-42fb348c-b3f4-4c2b-a76e-96aafe4c9453.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NjQ5OTQsIm5iZiI6MTcyNDQ2NDY5NCwicGF0aCI6Ii85NDYzNTcyMS8yNzg3MTExODAtNDJmYjM0OGMtYjNmNC00YzJiLWE3NmUtOTZhYWZlNGM5NDUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDAxNTgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJhYzFhYTdjZGI5MjRiMWI1MjEwMGQwZmNlNGJmODIzNTQ1YmY4ZDUwYjFkMTJiNWFjMjA5MTI3Mzc0NDlhY2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zDCh_x-imJbPnusKZ11zEhwtkLp1WfzB7pWB3yOX8kQ)
When the save button is clicked, the user will have the option to choose where to save the table or view in a XML format.
![image](https://private-user-images.githubusercontent.com/94635721/278711913-f5c4ff61-98c1-47ae-8c58-0ffa23003967.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NjQ5OTQsIm5iZiI6MTcyNDQ2NDY5NCwicGF0aCI6Ii85NDYzNTcyMS8yNzg3MTE5MTMtZjVjNGZmNjEtOThjMS00N2FlLThjNTgtMGZmYTIzMDAzOTY3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDAxNTgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0Zjk5Yjc1YThlODg1YTYyOWY0Y2ZkYmJhOTc3YTlkOGEzMGNmMjkzMTE0YTQ5ZDkxM2M5ODNhOTBiMjJlOWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DuIoJC065iQkL9sm5tt7IXCUuUEGLtbyuoN2oqGKVm4)
This is how the XML file will look like:
![image](https://private-user-images.githubusercontent.com/94635721/278712133-25445ac3-9409-4239-8c55-1c74cf6087d6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NjQ5OTQsIm5iZiI6MTcyNDQ2NDY5NCwicGF0aCI6Ii85NDYzNTcyMS8yNzg3MTIxMzMtMjU0NDVhYzMtOTQwOS00MjM5LThjNTUtMWM3NGNmNjA4N2Q2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDAxNTgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmMGZhY2I4MmJiZGU2ZmYyZWU5NzRmYTQ1Yjk5OTBhYjk4ZjQ0OWM5OTY4NjZkYTQ5M2JkMTYwODRmNTQxYmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Iu1hCTsZLUMA1YB3C4WFIAdLNcEPb9bmJIOCwTrRTvo)
When the new querey button is clicked, a new completely window will appear. This window consist in:
- In the top part a text-box where the user will write the query.
- In the right-bottom part a text-box where the user wont be able to write but where the message of the result of the query will be shown. That is, where the errors or success will appear.
- In the left-bottom part two buttons:
- One for running the query
- Other for cleaning the message and text box
![image](https://private-user-images.githubusercontent.com/94635721/278713572-030c9b60-eea5-4947-9121-3524858c575b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NjQ5OTQsIm5iZiI6MTcyNDQ2NDY5NCwicGF0aCI6Ii85NDYzNTcyMS8yNzg3MTM1NzItMDMwYzliNjAtZWVhNS00OTQ3LTkxMjEtMzUyNDg1OGM1NzViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDAxNTgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmYjQyYjExYWNlNjQ1NDc2Zjk1ZTNmM2JjNGEwMWUzZWVhMTViNzkyM2I3YTM0N2FlMjA3ZDZlYmQ0ZjI1ODAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.isjh_gm1ByHsVmi1KfcclL5wOgtOOGUnsV6xxKIjvrw)
When running the query, if it is a Select
query, the application will show the table as it is shown when the run table action. The errors happened in the query will be shown in the message-box. Here there are some examples of how the run query works:
![image](https://private-user-images.githubusercontent.com/94635721/278714982-17c34037-5a86-4940-a369-356c7923c2b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NjQ5OTQsIm5iZiI6MTcyNDQ2NDY5NCwicGF0aCI6Ii85NDYzNTcyMS8yNzg3MTQ5ODItMTdjMzQwMzctNWE4Ni00OTQwLWEzNjktMzU2Yzc5MjNjMmI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDAxNTgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ2NWU2OWM4Y2QzMDM0OGUxMjMwMTMyMzVmYTgwNWQxMDc2YzZmMjZjZjNlNDFiM2ZiNGVkYTM3MDg2Njk2NDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gfNhao5JVrbda1Q4XZUgcydVubzd4BlpGtALgKvcbEE)
![image](https://private-user-images.githubusercontent.com/94635721/278715168-a33a0276-e18b-4346-b7f7-fd7326730be5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ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kPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cUBnoABJD1rYq1ssl6iImiyRV9NfkIdXXxK6kVm65ro)
The patterns used in this project are:
The Lazy pattern it is mostly used by the tree view. So this tree view will load only what he needs when a node is expanded. All the entities (tables, views and procedures) inside the database
object are lazy properties.
The factory pattern is used to create objects that implements the IRepository
interface.
The factory of IRepository
s is a singleton.