473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Specified Cast Is Not Valid

this question in datagrid group for several days with no
repsonse.
I'm hoping for an answer her because of greater activity in this group.
No cross-posting intended. Thanks.
-----------------------------------------------------------

Server
VS.NET 2003
SQLServer 2000
IIS 66.0
----------------------------------
1. I have sever web pages with datagrids that draw info from different
respecitve SQLServer tables.

2. The datagrids have Item Templates columns for editing data.

3. The pages initially load their data into the datagrids fine, but when I
edit data, I get the 'Specified Cast IS Not Valid' error below.

4. NOTE: All these pages worked fine for Many Months for data editing, and
then this error started at the same time on all the pages with datagrids.

Other pages with just text boxes used for editing still work fine..

5. Was there anything in any automatic Windows or Net Framework update that
might have changed something?

Thanks very much for any help.

I can't figure this one out. I hadn't changed anything.

Alan


Server Error in '/' Application.
----------------------------------------------------------------------------
----

Code Section
----------------------------------------
protected void RowChanged(object sender, System.EventArgs e)
{
// Add changed record ID's to ChangedRecordList for SaveRecord loop
DataGridItem dgi = (DataGridItem) (((Control) sender).NamingContainer);
int recordID = int.Parse(dgi.Cells[0].Text);

// Add to list if not already there
if(!ChangedRecordIDList.Contains(recordID))
{
ChangedRecordIDList.Add(recordID);
}
}

Error Message:
--------------------------------
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:

Line 167: {
Line 168: // Add changed record ID's to ChangedRecordList for SaveRecord
loop
Line 169: DataGridItem dgi = (DataGridItem) (((Control)
sender).NamingContainer);
Line 170: int recordID = int.Parse(dgi.Cells[0].Text);
Line 171:
Source File: d:\inetpub\wwwroot\winfundssql\default.aspx.cs Line: 169

Stack Trace:

[InvalidCastException: Specified cast is not valid.]
NetFunds.Values.RowChanged(Object sender, EventArgs e) in
d:\inetpub\wwwroot\winfundssql\default.aspx.cs:169
System.Web.UI.WebControls.TextBox.OnTextChanged(Ev entArgs e) +108

System.Web.UI.WebControls.TextBox.System.Web.UI.IP ostBackDataHandler.RaisePo
stDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1081


Nov 19 '05 #1
0 1593

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tao | last post by:
I just upgraded .NET framework to 1.1 and VS.Net to 2003 version and tried to test it out. I created an ASP.NET project using the wizard and tried to run it by hitting "F5". I got an exception:...
4
by: Tyro | last post by:
Can someone shed some light on my error here? Thanks! Specified cast is not valid. Exception Details: System.InvalidCastException: Specified cast is not valid. Source Error: Stack Trace:
3
by: PK9 | last post by:
I am looking for assistance in pinpointing the cause of the following exception. I am getting a "Specified Cast is not valid" exception on my page. I am trying to populate a datagrid. One of my...
2
by: Fabian | last post by:
Hi, I work with asp.net 2.0 and I have a intermittent error, only happens a few times a day. In the page I evaluate a Query String and then I get data form a database. The code snipped: ...
3
by: VB Programmer | last post by:
I am setting up forms authentication. In my code I keep getting this error. Any ideas? Error.... Server Error in '/LandOLots' Application....
0
by: QA | last post by:
I am using a Business Scorecard Accelarator in a Sharepoint Portal 2003 using SQL Server 2005 I am getting the following error: Error,5/7/2005 10:50:14 AM,580,AUE1\Administrator,"Specified cast is...
8
by: Gamma | last post by:
I'm trying to inherit subclass from System.Diagnostics.Process, but whenever I cast a "Process" object to it's subclass, I encounter an exception "System.InvalidCastException" ("Specified cast is...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
2
by: vinrin | last post by:
Thank for your answer. :-) call CheckEmptyNode (treeview) public void CheckEmptyNode( Object N ) { Microsoft.Web.UI.WebControls.TreeNode menuNode = null; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.