Configure Data Source generating select statements with []

Configure Data Source generating select statements with []

Postby 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:


ConnectionString="<%$ ConnectionStrings:datafileConnectionString %>"
ProviderName="<%$ ConnectionStrings:datafileConnectionString.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!
mjwilde
 
Posts: 1
Joined: Mon 25 Jul 2011 13:54

Postby 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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL