Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : .NET : ADO.NET : Compilation Error Signup · Login
Author Thread
Compilation Error
Posted in tutorial: Viewing/Adding/Editing/Removing Records from MySQL using ASP.NET DataGrid control
·  mons
User
Joined: 2 Jul 2003
Total Posts: 2

Compilation Error

Posted: 2 Jul 2003
Hi,

I have followed the first article :

Accessing MySQL Database with ASP.NET

It was a breeze and very simple to follow. What a great article !!!

I then tried the next article:

Viewing/Adding/Editing/Removing Records from MySQL using ASP.NET DataGrid control

Which again was easy to follow until I came to run the editnames.aspx ASP.NET page.

I keep getting the following error:


Server Error in '/mons' Application. (my virtual directory on iis)
-----------------------------------------

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request.
Please review the following specific error details and modify your source code appropriately.

Compiler Error Message:

CS0117: 'System.Web.UI.WebControls.DataGridItem' does not contain a definition for 'Findcontrol'

Source Error:

Line 102: {
Line 103: case "Delete":
Line 104: Literal literal1 = (Literal)e.Item.Findcontrol("Literal1");
Line 105: DoDeleteName(Convert.ToInt32(literal1.Text));
Line 106: BindDataGrid();


Source File: C:\Inetpub\wwwroot\test\editnames.aspx Line: 104


Show Detailed Compiler Output:

C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /t:library /utf8output /R:"c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mons\9c804586\df8480e\r_hos5eb.dll" /debug- /optimize+ /win32res:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mons\9c804586\df8480e\r_hos5eb.res" /warnaserror /w:1 "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mons\9c804586\df8480e\r_hos5eb.0.cs"


Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

C:\Inetpub\wwwroot\test\editnames.aspx(104,37): error CS0117: 'System.Web.UI.WebControls.DataGridItem' does not contain a definition for 'Findcontrol'
C:\Inetpub\wwwroot\test\editnames.aspx(124,33): error CS0117: 'System.Web.UI.WebControls.DataGridItem' does not contain a definition for 'Findcontrol'
C:\Inetpub\wwwroot\test\editnames.aspx(125,33): error CS0117: 'System.Web.UI.WebControls.DataGridItem' does not contain a definition for 'Findcontrol'
C:\Inetpub


I would really appreciate any help that could be given.

Thanks

Mons.
·  NativeCode
User
Joined: 20 Feb 2003
Total Posts: 7
Re: Compilation Error
Posted: 9 Aug 2003
Surprising because System.Web.UI.WebControls.DataGridItem class
contains FindControl method, see below:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagriditemmemberstopic.asp

NC
·  Shafio
User
Joined: 19 Aug 2003
Total Posts: 1
Re: Compilation Error
Posted: 19 Aug 2003
After following the code in the tutorial i recieved the exact same error.

Having taken a look at the link to the msdn page I decided to change Findcontrol to FindControl . That solved the problem for me.

Hope that helps.
Want to leave a comment? Login or Register for free!

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.