Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Bug generating TabelAdapter on MySql

$
0
0

Hi,

The Dataset/TableAdapter, in Visual Studio 10, asp.net/VB built on  Mysql DB, generate insert/update/delete methods that has parameters named AS @p1 @p2 ... NOT AS the table Fields' Names. This cause two problems 1- during code writing, the name of the poped up parameters is meaningless 2- the GridView built up on that table adapter gives runtime ERROR at delete/update process, the error means that the all parameters of the delete/update method are duplicated, once as p1 p2 .. and another once as the table fields' name in the same method call.

take a look at the following sample of delete method definition and error:

XSD:

                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM `gen_settings` WHERE ((`CompanyNo` = @p1))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p1" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="CompanyNo" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>

Error:

Inner Exception Type: System.InvalidOperationException
Inner Exception: ObjectDataSource 'ObjectDataSource2' could not find a non-generic method 'Delete' that has parameters: p1, original_CompanyNo.
Inner Source: System.Web

Note that the same code was used on another developing PC without error, But when I installed a new developing PC I got this problem with the same code, so that I think it is related to the versions or a bug or installation issue.

Thanks

 


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>