473,545 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(obje ct sender, System.EventArg s e)
{
// Add changed record ID's to ChangedRecordLi st for SaveRecord loop
DataGridItem dgi = (DataGridItem) (((Control) sender).NamingC ontainer);
int recordID = int.Parse(dgi.C ells[0].Text);

// Add to list if not already there
if(!ChangedReco rdIDList.Contai ns(recordID))
{
ChangedRecordID List.Add(record ID);
}
}

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.InvalidC astException: Specified cast is not valid.

Source Error:

Line 167: {
Line 168: // Add changed record ID's to ChangedRecordLi st for SaveRecord
loop
Line 169: DataGridItem dgi = (DataGridItem) (((Control)
sender).NamingC ontainer);
Line 170: int recordID = int.Parse(dgi.C ells[0].Text);
Line 171:
Source File: d:\inetpub\wwwr oot\winfundssql \default.aspx.c s Line: 169

Stack Trace:

[InvalidCastExce ption: Specified cast is not valid.]
NetFunds.Values .RowChanged(Obj ect sender, EventArgs e) in
d:\inetpub\wwwr oot\winfundssql \default.aspx.c s:169
System.Web.UI.W ebControls.Text Box.OnTextChang ed(EventArgs e) +108

System.Web.UI.W ebControls.Text Box.System.Web. UI.IPostBackDat aHandler.RaiseP o
stDataChangedEv ent() +26
System.Web.UI.P age.RaiseChange dEvents() +115
System.Web.UI.P age.ProcessRequ estMain() +1081


Nov 19 '05 #1
0 1603

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

Similar topics

0
3616
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: "Specified cast is not valid." The only thing i put there was a "test this." inside the form. What might be the problem here? Thanks in advance. ...
4
7022
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
10498
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 columns is a template column where I'd like to evaluate the data brought back from the db and populate the column with a "Y" or "N" depending on the...
2
3084
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: try {
3
2170
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
623
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 not valid.","Microsoft.BusinessIntelligence.Scorecard.ScorecardException: Specified cast is not valid. --->...
8
4250
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 not valid"). How do I fix it ? using System.Diagnostics; .. .. class NewProcess: Process {
3
12420
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: ====================== Message: Specified cast is not valid. Type: System.InvalidCastException Source: System.Data.Linq TargetSite: Boolean...
2
8738
by: vinrin | last post by:
Thank for your answer. :-) call CheckEmptyNode (treeview) public void CheckEmptyNode( Object N ) { Microsoft.Web.UI.WebControls.TreeNode menuNode = null; Microsoft.Web.UI.WebControls.TreeNode iNode = null;
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7664
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7921
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5982
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
720
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.