Bug #35852 visual studio 2008 SqlDataSource dont work intuitively with .net connector 5.2.1
Submitted: 5 Apr 2008 10:43 Modified: 25 Feb 2010 11:00
Reporter: kris adidarma Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S4 (Feature request)
Version:5.2.1, 6.2.2 OS:Microsoft Windows
Assigned to: Reggie Burnett CPU Architecture:Any
Tags: .net connector 5.2.1, not working smoothly, SqlDataSource

[5 Apr 2008 10:43] kris adidarma
Description:
in visual studio 2008, when using .net connector 5.2.1, I am experiencing these problems with SqlDataSource:
- MySQL does not appear on New Connection>Change Data Source.  therefore need to use preconfigured connection string.
- SqlDataSource puts square bracket [] around column names.  therefore, need to go around this problem by using custom code or editing code behind.
- advance SQL generation does not work.  Therefore, need to generate Insert, Delete, update manually
- using "where" adds question mark only "?" therefore need to edit code behind.

How to repeat:
install visual studio 2008 professional, install .net connector

Suggested fix:
make a MySqlDataSource
[8 Apr 2008 18:06] Reggie Burnett
- MySQL does not appear on New Connection>Change Data Source.  therefore need to use preconfigured connection string.

this is a known issue that I am working on.

- SqlDataSource puts square bracket [] around column names.  therefore, need to go around this problem by using custom code or editing code behind.

this is a known issue and there is no work around.  It's a bug in VS

- advance SQL generation does not work.  Therefore, need to generate Insert, Delete,update manually

this should be fixed in 5.2.2

- using "where" adds question mark only "?" therefore need to edit code behind.

not sure about this one.
[10 Apr 2008 6:43] Tonci Grgin
Hi Kris. I would like to close this report now as Reggie seems to be aware of all of the problems related to your report. Do you agree?
[10 May 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[19 Jan 2010 21:37] Chuck Savage
Still adds [] to column names in 6.2.2 of plugin
[2 Feb 2010 11:43] Tonci Grgin
Chuck, it is *VS* that's adding brackets, please reread Reggie's comment.
[24 Feb 2010 0:05] Michael Bennett
Tonci, unfortunately that's not very helpful.  I think I can safely say that the connector's usefulness would be greatly improved if it played nicely with Visual Studio!

It is my understanding that square brackets are used by SQL Server to enclose strings that should be interpreted literally, which is why VS adds them to all your table and column names (in case they include spaces, for example).  This is similar to MySQL's use of the backquote (`), which you can easily see when you generate CREATE statements in Query Browser.  A simple replacement _might_ do the trick, though that's obviously kind of a hack solution.
[24 Feb 2010 7:15] Tonci Grgin
Chuck, I do not follow you. Can you please add sample project so I can test.

Michael, I agree but, actually, VS2008 and MSSQL2008 are so closely knit together one can't say which service is where. Check BI for example. So I do not know if this is even possible.

As for the rest of the stuff, it has been handled in later versions of c/NET so closing the report but will keep monitoring it.
[24 Feb 2010 8:21] Tonci Grgin
After consulting with Bogdan, I've decided to mark this report as verified in:
  - SqlDataSource puts square bracket [] around column names.  therefore, need to go around this problem by using custom code or editing code behind.
  This is a known issue and there is no work around.  It's a bug in VS

Reggie, can we work around this, maybe as Michael suggested?
[24 Feb 2010 9:53] Bogdan Degtyariov
screenshot

Attachment: bug_35852_screen.png (image/png, text), 41.33 KiB.

[24 Feb 2010 21:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/101392

845 Reggie Burnett	2010-02-25
      Implemented wl #5282 and fixed bug #35852.  sql server [] are now supported when you use the sql server mode connection string option.
[24 Feb 2010 21:56] Reggie Burnett
This is fixed in 6.3.1.  This is a new feature so we did not implement in older releases.  Please see worklog 5282.  This needs the new connection string option documented
[25 Feb 2010 11:00] Tony Bedford
Details of 'Sql Server Mode' connection string option have been added to the connection string option reference in the Connector/NET manual.

A 'change' entry has also been added to the 6.3.1 changelog:

Connector/NET was not compatible with Visual Studio wizards that used square brackets to delimit symbols.

Connector/NET has been changed to include a new connection string option Sql Server mode that supports use of square brackets to delimit symbols.