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