Strongly Typed Query

Strongly Typed Query

Postby giovanni » Tue 15 Sep 2009 18:34

Dear Friends,

I am developing a Web Service in Visual Studio 2008 (3.5 SP1). The web service will connect to a MySQL database and retrieve information based on certain parameters. Being that the MySQL database is 4.2.X, I am aware that I cannot create new queries and stored procedures (please correct me if I am wrong).

I have built a query in dbForgeFusion for MySQL and would like to use it (or something similar) to execute the SQL itself as I DO NOT want to embed SQL statements directly into my web service code behind file (.CS). I have examined the "Web Service" sample that comes with dotConnect for MySQL and it displays exactly what I don't want to see: SQL statements embedded in the code.

Is there a method or process to build an SQL query and then use it to strongly type the results instead of having to embed SQL statements directly into my code.

Best Regards,

Giovanni
giovanni
 
Posts: 5
Joined: Wed 09 Sep 2009 14:11

Postby AndreyR » Thu 17 Sep 2009 11:49

I recommend you to try the LINQ to MySQL technology. You will obtain full power of strongly typed queries.
But there are some limitations for the MySQL 4.2 version, like no support for triggers, views and stored procedures.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Binding to SQL Queries in Entity Develop

Postby giovanni » Thu 17 Sep 2009 14:00

Hi,

While I begin my possible endeavour into Entity Developer for MySQL, I do not see an obvious, if at all possible way, to connect to a simple SQL query with parameters. I know I can bind to stored procedures bu this requires an update of my client's MySQL server which is currently at 4.2.1 and subsequently does not have the ability to create and use stored procedures. Any workarounds possible. I have the SQL quyery, I just need to bind to it as you would a stored procedure and have the appropriate classes/entity classes generated as is currently available for database tables and stored procedures?

Giovanni
giovanni
 
Posts: 5
Joined: Wed 09 Sep 2009 14:11

Postby AndreyR » Fri 18 Sep 2009 11:29

I recommend you to write a LINQ query corresponding to the SQL query you have already written.
Then you will not see the SQL queries at all, only LINQ queries.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for MySQL