Nhibernate HQL SQL Server 2005 / 2008 CONTAINSTABLE - c#

do you know anyway how I to use CONTAINSTABLEvia HQL? I need to use CONTAINSTABLE, not just CONTAINS. Currently I am using a SQL-query, but I need to use the multi-query feature which is not avaiable for SQL right now.
If there is no such thing, would I be able to extend the MSSQL dialect? Or would that require to modify the core of NH?
Thanks in advance!

I have posted a NHibernate patch that will add support for custom SQL queries in a MultiQuery (see NH-2495 on http://jira.nhforge.org).

Related

Is there a way to do LINQ to SQL with MySQL for .NET Application?

I want to know if there's way to achieve LINQ to SQL today with MySQL database to generate a *dbml file?
I need the dbml file while running a MySQL database.I been going through a lot of old posts but didn't find the ideal solution.
I'm running .NET 4.7 with VS.
Linq-to-SQL was a "proof-of-concept" project for showing off the power of Linq and C# - but it only supports SQL Server and has no extensibility capabilities - and it's been long deprecated, too.
You should check out either Entity Framework which allows you to use Linq-to-Entities, or something like Dapper to access MySQL from .NET

How to migrate linq to sql for sqlce to sqlite?

I have a project with SQL Server CE as the database using Linq-to-SQL.
How can I replace SQL Server CE with another DBMS? (preferably SQLite)
I looked around the net for some info but nothing about replacing an RDBMS in a Linq-to-SQL scenario.
Best regards and thanks in advance!
Salih Goncu
Editing to reflect the comments:
The name of the product is "SQL Server Compact Edition" if you want the full name, or if abbreviated form is preferred, then SQL CE, as the Microsoft SQL Server Compact Edition team prefers to use in their own blog. http://blogs.msdn.com/b/sqlservercompact/
Second, Linq to Sql is not specific to SQL Server only. It is supported by many different RDBMS, including SQLite. The annoying fact is, when you create your schema, a code behind is also generated and there are SQL statements auto-generated in that code behind which needs to be converted. Doing that manually is tedious.
My revised question is, "is there an easy way of doing this conversion process?"
Thank you very much.
Did you try to install this package to make linq work with sqlite?
https://www.nuget.org/packages/linq2db.SQLite/

What database should I use for small dotnet Application?

I am developing a small application with ASP and C# in .NET and I want to have a small local database next to it where I can save and retrieve records by either SQL queries or Linq queries. I don't need anything powerful, just something to use instead of keeping records in .txt files.
So what's your suggestion?
Use SQLite
It does not have to be installed and is just a DB File and there are connectors to .Net available.
And you can use LINQ
I would go with either SQLLite or with XML since you are saying very small database.
And with xml you can use Linq to xml
You can use SQL CE or SQLite.
Best to use SQL Express edition since it comes for free. Try using .NET entity framework code first for rapid application development.
In any case application is very small consider using SQL express since you can write neat and clean stored procedures and can play with other database objects.
Please refer http://www.microsoft.com/sqlserver/en/us/editions/express.aspx for more details.
I'll consider SQLite for this purposes.
If you are more comfortable with MS tools, or for some reason (i.e. your company already has a well formed mdb database file) you can use MS Access too, for local and small applications.
I recommend you to use SQL Server Express, becuase
It is free to use and easy to install
You can easily use either Entity Framework or LINQ TO SQL to manipulate your data
It can easily communicate with your company's DB ( if it is also SQL Server), for example, one day in the future, you may need to test the replication.
No one's mentioned it yet so here it is. mySQL and the .Net mySQL client.
In your case I would consider the following:
XML if you don't with more than a couple hundred records in all tables. And #Ali mentioned already LINQ to XML what will be handy.
VistaDB, because it's 100% managed code and require deployment of just one small assembly for both 32- and 64-bit.
SQL CE, just because it's the most popular one. Of course, it supports LINQ and concurrency.
SQLite as an alternative for SQL CE :)
Don't go with SQL Express unless it's been already provided by your hoster. It increases complexity of distributing/installing of your solution.

Does Linq to Entities 4.0 have Fulltext capabilities?

Just wanted to know if Linq to entities 4.0 have fulltext search capabilities? Thanks
There are no specific operators or support for full text directly in EF v4.0.
I think that is a server option.
Anyways, if it does not (in EF), nothing stops you from calling the required SQL directly. :)
I've been using custom stored procedures for my Sql Server 2008 FullText capabilities (eg. CONTAINS(.. .. ). Of course, EF can call stored procedures.
This is an option you can leverage off. Works great for L2S and/or EF.
HTH.

Can you use LINQ tools such as SQLMetal with an access database?

I'm creating a small database application to teach myself the following concepts
C# programming
.Net 3.5 framework
WPF
LINQ ORM
I want to use Microsoft Access as the database but I can't seem to find any mention of whether its possible to use SQLMetal to generate the ORM code from a Microsoft Access database.
Does anyone know if this is possible?
If not, are there any small database or embedded databases I could use? I think SQL express would be overkill for me at this point.
For an embedded database, you can use SQL Server Compact Edition. Unlike SQL Server Express, it is not compatible with the LINQ to SQL designer, but it is fully compatible with the command-line SQLMetal. It has a few advantages over SQL Express, like to ability to use embedded or run from a file. Microsoft has a very handy chart outlining the differences between Express and Compact.
I don't think SQL Express would be overkill if you want to learn real-world skills - quite the opposite in fact! That'd be my choice, and whatever I chose, I'd stay clear of Access.
Good luck
AFAIK, Linq to SQL is MSSQL server provider specific. To be honest, SQL Express is pretty lightweight on todays machines.
BTW don't confuse LINQ with Linq to SQL. Linq is the underlying technology to provide "query" like support to .NET (amongst other things), where as L2S is effectively a Data Access technology built on top of Linq. Vanilla Linq will work with any ADO.NET provider, which of course Access is one.
Entity Framework will work with any compatible provider also but if SQLExpress is too heavy for you then I wouldn't recommend going down this path...
Thanks for all the responses. I never expected to get an answer this quick. For my test application I think SQL Server Compact Edition would be the way to go. I'm basically creating a money managment app similar to Microsoft Money and although it is an exercise to learn skills, I would eventually want to use it to manage my finances (provided its not too crap!)
This why I thought a fully blown database would be overkill.

Categories