I need to give my customers an ability to select virtually any data from the database. They are regular users, don't know SQL, know nothing about tables, relations etc.
Is there some component/tool with simple GUI that I can customize for my database structure?
Right now I need it for WPF project, but I'm also interested in ASP.NET tool for future.
Thanks
You could provide your users with a flattened view of the data that denormalizes across relationships (since regular users don't 'get' relationships) and provide them with the ability to choose which columns the want to see and which values they want to filter on
Try EasyQuery.NET.
It seems they have released WPF version recently (I'm subscribed to their newsletter).
Related
I have a simple form with DataGridView thas uses DataSet's DataTables as a data source. I need to save data added, changed or deleted in the DataGridView to the database. However, there is a catch. I don't have all the database information hardcoded. Instead, user inputs it at the runtime. I was trying to use SqlCommandBuilder, but it looks like the database has to have an unique identifier in order for it to work. Is there any other way around? Or do i have to limit the user to use only databases with unique identifiers? And even then, do i have to write custom commands for insert/delete/update? Or standart methods will work?
I'm not completely sure where you are going with your application so I may be a little of base with some details below, but feel free to leave some comments and I'll try to restructure the answer if I'm off base.
First, if you are building an application of any size, consider using WPF rather than winforms. It provides significantly more power and flexibility and is recommended over winforms. If you do use WPF, then you should take a look at the MVVM pattern to track your data.
As far as the user choosing a database at runtime. Do you have a finite set of Databases that can be connected to? If so you can set the connection details behind the scenes and let the user select from a dropdown which connection they want to use.
For reading/writing to a database I would recommend using the Entity Framework.
I've been trying to figure this out for a few hours now, and no amount og Google search
has yielded anything usefull, I'm currently studying up on my exam and I believe i will need to know these things, so i hope someone can help me!
I have two questions;
Is it not possible to create a new table? (Or Entity i believe it is called)
And also, is it possible to display all table's you have?
I'm making a small forms project where I'm basically just making methods that will carry out the different commands that Linq to Entity proves.
Such as a a controle to create a new table with the name put in the textbox,
a listbox displaying all tables in the database and so on.
Hopefully someone will be able to help.
~Etarnalazure.
1: no, list MOST ORM's it is a data access technology. EntityFramework has schema updates etc., but again this is not "runtime".
2: no, again, this is not a technology to manage databases. YOu only can query what you have classes for.
Well, 2 IS possible, but you have to generate the classes in a separate appdomain at runtime, then use that to query for data.
I am developing an application that requires "some" customization by the enduser afecting the database design (beyond the parametrization).
Now a days this application supports to work with new columns for the existing tables or even new tables in runtime. But the enduser is not capable to alter the tables, and all the design work must be done using Microsoft SQL Server Magament Studio.
My question is: there is any kind of control (or tool) which implements this functionality? I would like to have it embeded in my application, but if it is a external tool wouldn't be so bad.
What I want to have is some tool that let the user define a repository of columns (name, type, size) for example:
CustomerCode, BIGINT, n/a
CustomerName, Varchar, 50
And then create or alter a table or view by adding these predefined columns. And underneath should execute the needed SQL script or maybe using SMO (SQL Management Objects).
Updated
Currently it's the application works with WinForms, but any WPF / ASP solution would be appreciated.
And referring to and enduser I mean a app administrator but not with programing skills.
Purpouse
The purpose is to be able to extend and customize the functionality from the own apllication without having to use SQL Server Managment Studio.
Imagine that you have an ERP, as a user you want to inform in your customers table something that the application was not orginally intended and even has no free fields for it, for example: GPS location, logo, CEO's photo...
Of course I can suggest to some advanced users to install SSMS Express, but that will give them too much freedom. I also think it is a IT tool. What I wanted is to develop the capability to modify the application from the own framework of the application.
If it can be done from the own application, some controls can be performed:
Check that a table field called X will be always defined with the same type,
Disable the capability to modify the non-customizable fields (application fields),
...
Alex, I think you should try to give the user the flexibility to add new information to the database without really change the design of the database.
You can take a look at EAV Model (entity-attribute-value). This give you the flexibilty to add any new attribute to customer without change the design of customer table (e.g.).
One good example is Magento, they did a great job with EAV (entity-attribute-value) but you must know that this design model will hit your performance a little (or a lot depends how you implement it).
It seems that this kind of control does not exists, so I will scratch it from 0.
#BrunoCosta's idea of using an EAV model to extend the standard application is a good practice. But I pretend to have a tool to modify the standard, and have a tool used for the final user and also for the developer. A pseudo SQL Server Studio + Visual Studio embedded in the a application.
Once I develop it, I will to post it in CodeProject.
I think that the control you are looking for may be a little too unique. However, I don't think it would be too difficult create this yourself using other controls/libraries.
I am just finishing up a similar WPF project.
I found that the DataGrid class worked well for representing a table. You can add/remove columns programmatically. Although you would be generating the SQL script yourself.
I could be re-inventing the wheel - but..
I need to allow a user to be able to build 'customer reports' from our database - which will be from a GUI.
They can't have access to SQL just a list of Tables (Data groups) and columns within those groups.
They also have the ability to create Where clauses (criteria).
I've looked around Google - but nothing cropped up.
Any ideas?
well my recommendation, Developer express have some amazing end user criteria builder, you can use theirs.
there are other controls to create end users criteria , like
http://devtools.korzh.com/query-builder-net/
I hope that help you
both controls above abstract the data acess layer so your end users wont have access to send a direct query to the database. The controls only build the criteria and its your work to send the query to the database.
As a precurser to my answer, there are a number of expensive products out there like Izenda (www.izenda.com) that will do this very elegantly...
If you want to roll your own (and to speak to your question) you can fake this pretty quickly (and yes, this does not scale well to more than about 4 joins) like this:
Create a join statement that encompasses all of your tables that you want to use.
Create a dictionary of all available fields you want to expose to the user such as this: Dictionary = Dictionary<[Pretty displayable name], [fully qualified Sql field name]>
Let the user build a select list of fields they want to see and conditions they want add from the dictionary above and use the dictionary value to concat the sql string together that is necessary to return their results.
(I'm skipping quite a bit of validation work about making sure that the user doesn't try to mis-type the condition and such, but essentially point of this is that for a small collection of tables you can create a static "from" statement and then safely tack on the concat'ed "select" and "where" that the user builds)
Note that I've worked on some systems that actually stored the relationships of the table and compiled the most efficient "from" statement possible... that is not a huge stretch from this answer, it's just a bit more work.
I strongly recommend going with an existing product like Crystal Reports, Sql Server Report Builder, or Infomaker. It's just so easy to get something that seems to work, but leaves you open for an sql injection attack.
If you do go ahead, I recommend using a separate sql connection for these reports. This connection should have a user account that only has read privileges anywhere in the database.
Thanks for the answers! We ended up doing this ourselves through a collection of views!
For instances:
Sales View
Customer View
The views already take care of most of the joining between tables and return as much joined data as they can.
The user then selects what columns they could like to see from each view and we do the join between the views at code level.
The resulting statement is very small as the views take most of the work out of it.
I have mobile application, so i dont want to send/receive whole changes in tables..Just some data, that meets some filter terms. Is it possible to achieve with SF; if it is, please provide some resources to read about it, because i found almost nothing.
Thank You.
Yes its possible. For example you might only want to sync the records relating to a specific store, rather than all the changes in the store table.
You do this by adding a parameter to the SyncParameters collection. e.g.
m_SyncAgent.Configuration.SyncParameters.Add("#ParamName", paramValue)
This will pass the parameter data to the serverside of the Sync process, which you can then use to sync only the data you want to include.
It's definitely possible with SQL Server Replication Services (SSRS). You can select which tables, fields, and even apply filters to the publication. I'm not familiar with Sync Framework but SSRS subscriptions appear in the Sync Center, so my assumption is that Sync Framework uses SSRS.