Bug #33870 Generated database prefix and connection string
Submitted: 14 Jan 2008 18:36 Modified: 17 Oct 2008 9:15
Reporter: Renaud Paquay
Status: Verified
Category:Connector/Net Severity:S2 (Serious)
Version:5.1.4, 5.2.4 OS:Microsoft Windows (Vista)
Assigned to: Reggie Burnett Target Version:
Tags: table prefix connection string
Triage: D2 (Serious)

[14 Jan 2008 18:36] Renaud Paquay
Description:
The problem appears when using Data Provider for MySql and strong typed DataSet.

I develop my application using strong typed datasets.

When I drag and drop a table into the xsd, a code is auto generated which contains the
connection, the select statement, and so on.

The problem is that the generated code contains the dabase prefix like :
SELECT `ID`,`Name` from `databaseName`.`Customers`;

When using strong typed dataset, the connection is normally created with :
global::<myNameSpace>.Properties.Settings.Default.<myConnectionStringName>

When I change the Application setting in my app.exe.config, due to the database prefix,
nothing changes.

How to repeat:
Create a new application with a MySqlData Provider for mysql.

Drop a table into a new xsd.

Go to the <MyDataSetName>.Designer.cs

Observe the generated update or select commands.

Suggested fix:
Do not generate the database prefix as it should be defined at Application Setting level.
[17 Oct 2008 2:46] Cyrille Giquello
Hello,
I completly agree with Renaud, the database prefix is a real problem.

1. When changing from development database to test database then production database,
names are not same.
2. When hosting several times the same application that need distinct database for each
instance.

Regards,
Cyrille
[17 Oct 2008 2:49] Cyrille Giquello
problem persists with version 5.2.2
[17 Oct 2008 9:15] Tonci Grgin
Hi Renaud and thanks for your report.

I can't make up my mind on how to treat this problem as both approaches have their good
and bad side. But I am setting report to verified on the bases of inconsistency:
  Looking into autogenerated, for example, UPDATE command one sees "database." prefix but
if you open same command in query builder the prefix is gone. This should at least
look/behave in uniform fashion.

Verified as described.
[17 Oct 2008 9:18] Tonci Grgin
DB prefix present in object explorer

Attachment: BUG33870-1.JPG (image/jpeg, text), 47.44 KiB.

[17 Oct 2008 9:19] Tonci Grgin
DB prefix *not* present in QB (same command)

Attachment: BUG33870-2.JPG (image/jpeg, text), 33.13 KiB.

[20 Oct 2008 8:57] Tonci Grgin
To be checked together with Bug#38922.
[26 Aug 7:55] Tonci Grgin
Bug#38922 was marked as duplicate of this report.
[26 Aug 12:53] Tonci Grgin
Bug#46930 was marked as duplicate of this report.
[31 Aug 15:54] The Assimilator
Error generated when removing database name from CommandText

Attachment: sproc-param-error.PNG (image/png, text), 13.25 KiB.

[31 Aug 23:57] Reggie Burnett
Downgrading this to medium since there is a valid workaround.