Configure Data Source generating select statements with []

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
mjwilde
Posts: 1
Joined: Mon 25 Jul 2011 13:54

Configure Data Source generating select statements with []

Post by mjwilde » Mon 25 Jul 2011 14:14

I am using Visual Studio 2010 Express and dotConnect, which I downloaded last week. I am connecting to a mySQL 5.5.8 database.

I can connect to the data source fine and can see the tables and their columns.

However, when I 'Configure the Select Statement' using 'Specify columns from a table or view', the code is generated with square brackets around the column names:


"
ProviderName=""


SelectCommand="SELECT [_ID] AS column1, [ORDER_REF], [STATUS], [ACCOUNT], [DATE_INPUT], [DATE_AMEND], [ORDER_VALUE], [INVOICE_VALUE], [CUST_REF], [DATE_INVOICED], [DATE_DELIV], [DATE_ACKNOW] FROM [cel_soh]">


I have to manually remove the brackets before things will work. This in turn converts it into a custom SQL statement which means that editing it is much more difficult.

Please can someone advise?

Many thanks!

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 27 Jul 2011 11:27

It seems like you are using standard System.Web.UI.WebControls.SqlDataSource that is not adjusted for working with MySQL database.
We recommend you using Devart.Data.MySql.Web.MySqlDataSource which generates a valid SQL and includes convinient editors for update commands. Please note that MySqlDataSource is available only in the Professional and Developer editions of dotConnect for MySQL: http://www.devart.com/dotconnect/mysql/editions.html. dotConnect for MySQL Professional Trial (free use during 30 days) can be downloaded from http://www.devart.com/dotconnect/mysql/download.html.

As you are using the Express edition of Visual Studio 2010, you should follow these additional steps to add the Devart components into your Toolbox:
- Open Visual Studio and go to Toolbox window;
- Add 'MySQL Data' tab using right mouse button;
- Select Choose Items... from popup menu;
- Go to .NET Framework Components tab within opened dialog;
- Check the components the Namespace column of which starts with "Devart";
- Press OK button.
After this, MySqlDataSource will be available in the web projects.

Post Reply