Type ‘System.Web.UI.WebControls.Parameter’ does not have a public property named ‘DbType’

In Visual C# 2005 SP1, I added an object data source to a web page that uses my business class as the select method. The method has one parameter of type Guid. The data source wizard generates code like this

<asp:Parameter DbType=”Guid” Name=”rowId” />

Although the web server has .Net 2.0 SP1 installed (I checked the registry), it still throws an error

Type ‘System.Web.UI.WebControls.Parameter’ does not have a public property named ‘DbType’

The walk around is easy:

<asp:Parameter Type=”Object” Name=”rowId” />

About Sheng Jiang 蒋晟

Microsoft MVP in Visual C , 2004- Forum moderator of the Visual C and .Net forums on CSDN Forum moderator of Chinese forums on Microsoft's MSDN forums
This entry was posted in Microsoft and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s