SQL Server query designer on C# application - c#

I have been given the tasking of providing a desktop solution which allows a user to simply and safely create bespoke reporting queries where their knowledge of the database is limited.
Immediately what came to mind is the SQL server query designer in SSMS. I have searched the internet with no success of whether this can be integrated into a C# Windows Forms application. Has anyone had any success of invoking this functionality in C#?

I used to work with Korzh's EasyQuery component in ASP.NET MVC, but they have the WinForms edition too.
It seems like exactly what you need - the database structure is hidden, end user operates with visual "conditions" and "columns", you get an SQL query as a result.
Here is the link: http://devtools.korzh.com/easyquery/

Related

(Change Datasource) Prompt for Server and SQL Server database within Crystal Reports Viewer, Visual Studio (C#)

I'm using SAP Crystal Reports 2016 with the Visual Studio plugin, along with Visual Studio 2015.
What I've done is created a simple MDI application using C# which contains multiple Crystal Reports Viewer forms which open an embedded report in a child window when the menu item is clicked. This application will sit on our development server and be used to run reports against client databases that get sent to us with problems.
Here's the issue. We've got multiple instances (and versions) of SQL Server running and we are getting multiple test databases daily which of course will be named differently. The reports are looking for a specific database only.
What I would like to do, is either on form load or via a button click, be able to have a box prompt the user for server and database name. For example:
SQLServer\SuperCoolInstance
My_Cool_Database
The report would then connect to that database and display relevant information.
Any idea on how I could accomplish this? Second best scenario would be to have something like an XML file that contains the server and database and the program looks at that when launching. Even though we'd have to edit the XML whenever we wanted to change datasources it would be something! I wouldn't know how to pursue that avenue either though.
I would think that this must be possible because at a previous company that I worked for, they actually sent compiled Crystal Reports (in exe format) to clients to run on THEIR systems and it looked to an already existing XML file.
Thanks very much in advance for any ideas or guidance.
Cheers.
EDIT - I thought I should point out that all the SQL Server databases that this would run on would have identical schema but different data obviously. Not that this probably matters for this particular question, but just in case. :)

Sharepoint form writing to sql database

I want to build a form that will edit a table on SQL server. I known how to do it in ASP.NET (I need two drop down lists, gridview and button) but I want to make it as a part of SharePoint.
Can someone tell me what is the best technology to do that, I was looking at InfoPath but it seems I can not run it in web browser (only InfoPath filler). I just want to build simple form that is a part of Sharepoint and that is working in web browser. Please help.
Best regards
Daniel
One easy approach to read/write from/to SQL databases in SharePoint is to sync the external data with SharePoint lists. In this way you have the full feature set of lists available with best performance and highest security. Users are just working with a synchronized copy of the external data in the lists. To sync the data you can program by yourself, use PowerShell or 3rd party sync tools like the Layer2 Cloud Connector.
It is not a best practice in SharePoint to directly change the database.
One way you can do is Connecting to SQL Server Using the External Content Type Feature
http://www.dotnetcurry.com/sharepoint/794/sharepoint-2010-connect-sql-server-external-content-type
If you want to change directly , As you already know how to do it in Asp.net , you can go for Visual Webpart with same asp.net gridview and connection string

Using a database or table structure within program

Basically all I want is to be able to create like a self contained database in my Windows Forms application, I do not want to connect to a server or anything like that with SQL Server, I just want like a small database in the application that can handle a few transactions.
Like for instance if I create a Windows Forms application then it would have its own small database in it and when deploying it.. it will save rows there and stuff. I remember hearing about a plug in, it started with a CT or something don't recall, but it would be a plugin for Visual Studio.
Any help would be much appreciated.
Regards
You can use SQL Server Compact or SQLite (ADO.NET provider is available here). Both are embedded database engines that run in-process. You don't need to install anything, just include the appropriate DLLs with your application.
Visual Studio has no problem providing you with just such a database. Just right click your project, add new item, and select SQL Server Database. The database created will be part of your project and can be deployed as needed.
If you have a limited amount of data you can just right-click the project and Add a DataSet. Then you can define multiple tables in the .xsd and store multiple rows. in the .xml. Then you can write some simple code in the .xsd code-behind to auto load and save defaults and even pull back rows of data. I typically use this approach for storing a single record in each table. It will also work with multiple records in each table. There's a point where if you start to get a lot of data you'll probably wish you had used something like SQL Compact Edition or something similar that you bundle with your app.
you can use sqlLite,this is the website
http://www.sqlite.org/
or you can use access too

What is the best way to develop a C# project with a MySQL backend?

So I'm using C# 2010 Express and wondering what the best toolset is for developing a C# project with a MySQL backend? I know what if you use SQL Server Compact edition from within C# it will let you access the DB directly from the IDE. Is there a similar way to integrate the development with a remote MySQL Database?
Also, is MySQL a versatile enough solution for writing a program with C#? I am looking to build a seperate PHP web site (a reporting portal) that will access the MySQL data. I'd love to go open source all the way, but it seems like C# is the best app to create the app I'm trying to create (touch screen interface for data entry).
Whenever I program a database related homepage I always use HeidiSql and mysql. Both of them are easy to figure out and fast to use.
From their site:
HeidiSQL is a lightweight, Windows
based interface for MySQL databases.
It enables you to browse and edit
data, create and edit tables, views,
procedures, triggers and scheduled
events. Also, you can export structure
and data either to SQL file, clipboard
or to other servers.
All you do is install Mysql, set up a pass and username. and it's up and running.
Then all that's left is to install Heidisql. Heidisql it is a free program. If you need more details on how to attach heidi to your database please do write again.
There is
http://www.devart.com/dbforge/mysql/fusion/
But it's not free and is a plugin which you can't use with Express. There is no way to do this with Express as you can't add onto the basic functionality.

what database should i choose?

I use winforms to develop a desktop application, and right now I plan to use SQL server express, but the problem is, if i use sql server express, then the installation is much trouble, i need to install sql server first, and install my own applicaiton.
Then I tried to use access 2003 as my database, then I only need to copy the mdb file with my application. But the access 's function is not that strong, the text length is limited to 255 byte.
Is there any other database solution, which is easy to integrate to my application, and easy to install after i develop my application ?
Many many desktop application have their own database, and easy to install and easy to use, what database do they use ?
SQLite. Extremely robust and easy to work with, and has C# bindings. It is now the most widely deployed embedded database. The DLL is under 300Kb.
Use SQL Server Compact Edition (CE). It's free, and comes with Visual Studio. It's file-based, but can easily synchronize with a "real" SQL Server database.
I was going to post a list of links to SQL CE information, but I found too many good links with the following search: http://social.msdn.microsoft.com/Search/en-US?query=sql+server+compact+edition.
you can try Non-Sql db, like Db4o, it's:
easy to set up
easy learning curve
C# native
Object oriented
Light weight

Categories