Where can I find a graphical designer for linq [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'd like to allow my users to design and create LINQ queries even if they don't know LINQ.
So I am thinking about having a "SQL management studio" like window with the list of tables, fields and relationships and let the user drag and drop.
I could write it myself but it looks difficult. Is there a better way?
Is there a solution somewhere I could use?

LINQPad

I don't believe anyone's tried to tackle this (that I can find at the moment, at least) - it would need to be implemented with dynamic queries driven by the UI. Some links related to that:
http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx
http://www.albahari.com/nutshell/predicatebuilder.aspx
On a side note, if you're letting the users drive the query generation, though, I'm not sure what LINQ is getting you off-hand?
IOW, one alternative might be to use one of the existing GUI interfaces for generating the sql query and use that. If you want to still be able to interact with the strongly-typed classes that your linq-to-sql or linq-to-entities context gives you, you can go with query -> sqlcommand -> sqldatareader -> db.Translate as both give you Translate methods for this kind of scenario.

You could use one of available "SQL visual designers". It's very easy to translate a simple SQL to LINQ then.

Related

File for Stored Procedure methods in Repository pattern achitecture [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am using EF6 but would be calling too many SPs in my project.
I have already put the methods in MyDbContext.cs but since there are too many SP methods, I don't want to crowd the MyDbContext.cs. I want to place the methods in another file. Is there any alternative?
Any good example or article?
It seems like you are choosing between using Stored Procedure or ORM (in this case the EF6).
In that case, you can read this good article that may help you to decide :
Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures?
EDIT :
As far as I know, using Stored Procedures in Entity Framework is not the best practice, and it will only reduce the purpose why you choose the ORM in the first place.
However, if you insist, you may find this article quite comprehensively covering the topic you are talking about :
http://www.entityframeworktutorial.net/entityframework6/dbcontext.aspx
In short :
Yes, put all the SP callings in the DbContext
If possible, avoid SqlDataReader when you're using EF , or you will end up messing it up again with ADO.NET.
EDIT :
ADDITIONAL TIPS :
I just realized that you have to deal with so many SPs that can potentially make your DbContext class too crowded to manage. In that case, just use PARTIAL CLASS to organize many SPs into separate files, so you can manage them all a lot more easier.

Library for database (schema) management [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking for a .Net library which would act like an abstraction layer between the application and the database. The application mostly deals with structure alterations, like creating a new table or adding a column to existing table.
I would like to have the library which deals directly with database entities like tables, schemas or columns - so not really ORM (unless some ORMs have good "utility" layer). Support for PostgreSQL and SQL Server is required (Oracle and SQLite would be "a nice to have" feature).
Any free or commercial (but royalty-free i.e. no per-server license) solutions would be much appreciated.
For the DAL, I recommend NHibernate (http://nhibernate.info/)
It is a great all-rounder:
easy to use
good abstraction
powerful features.
It gets even better with FluentNhibernate (http://www.fluentnhibernate.org/)
--
If you are looking for something more speedy and light-weight, take a look at StackOverflow's very own Dapper (https://github.com/StackExchange/dapper-dot-net)

Is there a standalone tool to generate Entity Framework code first entities from an existing database? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I want the ability to generate POCO entities outside of Visual Studio. Is this possible?
I haven't found a standalone tool (outside of Visual Studio), but I've used the Visual Studio extension EntityFramework Reverse POCO Generator on a previous project when switching from Database First / Model First to Code First.
Why does it need to be a standalone tool? You could remove the extension after the conversion if it's a permanent switch.
EntityDeveloper by DevArt. Nice with UI and strong on updating the model, too. Sadly not free, but then not exactly expensive either.
I realize this is an old question, but it's an issue I'm facing myself currently.
I've managed to have some luck by using EdmGen.exe which is included with in .net4 framework installations, so it's most probably present on client machines.
EdmGen will generate Model and Mapping files and, in addition, you can Generate Object-Layer code with it.
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\edmgen.exe" /mode:fullgeneration /c:"Data Source=<DATASOURCE>; Initial Catalog=<CATALOG>; Integrated Security=SSPI" /project:<PROJECT> /entitycontainer:<ENTITY CONTAINER> /namespace:<NAMESPACE> /language:CSharp
After this you can go ahead a generate your Object-Layer code:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\edmgen.exe" /mode:EntityClassGeneration /incsdl:.\<PROJECT>.csdl /outobjectlayer:.\<PROJECT>.Objects.cs /language:CSharp
Obviously, you'll want to replace the <*> with your particular needs.
You can also replace \Framework\ with \Framework64\ in the path if you're on a 64-bit machine.
You can read up on all of the features here:
EDM Generator Docs
I've managed to get it working, but the performance has been deplorable. I'm working with a somewhat complex database with about 80 tables and 30-40 views and the fullgeneration took over an hour. I've seen other similar cases online, but haven't found a solution.
EDIT: I just ran into this excellent tutorial/article which helps automate the whole process. Hope this helps!

SQL Parsing in C#? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
in my application , i have a textbox where user can paste Sql (mainly from MS-ACCESS) , i need to parse this SQL and get the table names , joins , Columns etc.
is there a easy in c# rather than using string manupulation to do this activity?
i can think of implementing a BST aslo but don't have any clue where to start?
Irony for C# has an LALR parser with several grammars already created, including one for SQL (as you can see from the screenshot on the home page). It's a very easy to use parser using operator overloads to define the grammars in a way reminiscent to BNF.
I'd suggest ANTLR using SQL Server 2000 grammar as a template.
I've done some work using the gold parser to be able to parse and programatically explore SQL statements. In my case it is SQL 89 which would not include a fair amount of access syntax but may be someone you could build on.
http://www.codeproject.com/KB/linq/QueryAnything.aspx
It's still somewhat experimental but the underlying parsing is pretty flexible.
I have had some success using this: https://github.com/jehugaleahsa/SQLGeneration
It's free to use, is open source, worth checking out.

Where can I find an open source C# project that uses ADO.NET? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess backend for a pretty small database concept I have.
I have written this application once before in just MSAccess but I now need the app and database to be in different places. I have now figured out (thanks to a StackOverflow user) that ADO will be a bad choice because it has to have a connection open all of the time.
I bought Microsoft ADO.Net 2.0 Step-by-Step and I have read through some of it and understand (I think) the basic concepts at play in ADO.NET. (Datasets and the like)
Where I get confused is the actual implementation. What I want to know is do any of you know of a C# project that has a database backend which is open source that I can go look at the code and see how they did it. I find I learn better that way. The book has a CD with code examples that I may turn to, but I would rather see real code in a real app.
I haven't used this but it looks like it might be a good fit:
http://www.codeproject.com/KB/database/DBaseFactGenerics.aspx
Take a look at the MySQL .net connector. It is the nuts and bolts of how the ADO.net classes talk to the DB engine. ADO.net as a whole does not keep connections open. Certain higher level classes do. Technically the lower level objects such as the connection and command objects are part of ADO.net, but you have a high degree of control over them.
Check CodePlex, they have a ton of .NET projects. I can't think of specific ones that fit your requirements, but you should be able to find something.
www.codeplex.com
I found this post http://www.codeproject.com/KB/database/DatabaseAcessWithAdoNet1.aspx by searching for ADO.NET on the codeproject so I am going to give Chris Porter the answer points. Thanks everyone for the help.

Categories

Resources