Bug #30483 DbObjectType = "Unknown"
Submitted: 17 Aug 2007 18:51 Modified: 7 Nov 2007 11:25
Reporter: mkjhkjh kljhkjhk Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.21 OS:Microsoft Windows
Assigned to: Assigned Account CPU Architecture:Any
Triage: D3 (Medium)

[17 Aug 2007 18:51] mkjhkjh kljhkjhk
Description:
Bug related to creating TableAdapters inside MS Visual Studio 2005. The autogenerate of Delete/Insert/Update commands don't work automatically. Somehow it doesn't detect the object as a table. This happens only when using mysql-connector.

-- Using:
MySQL 5.x
mysql-connector-odbc-3.51.19
MS Visual Studio 2005

How to repeat:
Inside a ASP.NET project:

1) Configure a ODBC datasource in windows to connect to MySQL
2) Create a simple web project inside Visual Studio 2005
3) Create a new DataSet
4) Follow the TableAdapter wizard and create a simple SELECT query
5) Open the properties of your new TableAdapter
6) Try to change the property "GenerateDBDirectMethods" to "True" -> you will not be possible.
7) Now open you DataSet code (in the DataSet main screen click "View Code")
8) Change the property DbObjectType from "Unknown" to "Table.
9) Repeat step 6 -> now you'll see that the Delete/Insert/Update methods are populated correctly.

Suggested fix:
When creating the TableAdapter the property "DbObjectType" should be set to "Table".
[7 Nov 2007 11:25] Tonci Grgin
Hi and thanks for your report. Verified just as described using:
 - MySQL server 5.0.50pb on WinXP Pro SP2 localhost
 - VS 2005 Pro, MyODBC 3.51.21

        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DataTable1TableAdapter" GeneratorDataComponentClassName="DataTable1TableAdapter" Name="DataTable1" UserDataComponentName="DataTable1TableAdapter">
            <MainSource>
              <DbSource ConnectionRef="ODBC.localhost via TCP/IP.test" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT     bug22400.*
FROM         bug22400</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
[3 Dec 2010 7:58] Bogdan Degtyariov
verified with Connector/ODBC 3.51.27 and 5.1.8