473,811 Members | 3,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

am gettin specific cast not alowed error an anybody help

2 New Member
string Empid = e.Item.Cells[1].Text;
string Empname = ((TextBox)e.Ite m.Cells[2].Controls[0]).Text;
string date = ((TextBox)e.Ite m.Cells[3].Controls[0]).Text;
string Special=((TextB ox)e.Item.Cells[4].Controls[0]).Text;
string Sex=((TextBox)e .Item.Cells[5].Controls[0]).Text;



am getting 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 236: string date = ((TextBox)e.Ite m.Cells[3].Controls[0]).Text;
Line 237: string Special=((TextB ox)e.Item.Cells[4].Controls[0]).Text;
Line 238: string Sex=((TextBox)e .Item.Cells[5].Controls[0]).Text;
Line 239:
Line 240: //DateTime dt= String.Format(" {0:d}", date);
Mar 16 '07 #1
0 949

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4334
by: Simon Ford | last post by:
Hi All, I'm having trouble understanding exactly how I can do some specific implicit casting. There are two problems here; does anyone know what I should be doing? //---------- // (1) Resolving as bool for comparison, but not as int. // // we have a class
1
2423
by: eSapient | last post by:
I get the following error when I run the XML Schema Definition Tool on a XML schema: Error: Error generating classes for schema 'codeGeoFeatureType'. - Specified cast is not valid. The XSD in question is: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
1
1163
by: Ben Harper | last post by:
I define an interface in managed C++: I call it ISgPlugin. I implement that interface in a C# dll: Using reflection, I try to load and instantiate that interface from the C++ module. I get far, but not far enough: I use type->GetInterface( S"ISgPlugin" ) to get the type of a class inside the C# dll that implements ISgPlugin. That works. I then use type->GetConstructor() to get an appropriate constructor for that
2
3094
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 {
10
6964
by: PH | last post by:
Hi guys! I need to get the remote EndPoint from when I receive packets when listening in a local port in my computer. I'm using UDP (connection-less) so I only bind the socket to my localEndPoint, I do not Bind(), Connect() to a RemoteEndPoint.
2
1207
by: amit | last post by:
Hi guys I am trying to use Access Database with VB .net. In the stock database I have Fields Code and DrugName; Data Type of both is Text. In the following code line marked with *** gives the error "specific cast not valid " The type of both code and drugname is same so logically it should not
2
846
by: prasanth1802 | last post by:
string Empid = e.Item.Cells.Text; string Empname = ((TextBox)e.Item.Cells.Controls).Text; string date = ((TextBox)e.Item.Cells.Controls).Text; string Special=((TextBox)e.Item.Cells.Controls).Text; string Sex=((TextBox)e.Item.Cells.Controls).Text; am getting 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...
11
1793
by: Dinsdale | last post by:
I am trying to determine what the current cast of an object is. Essentially, if I use GetType, it always returns the original type of the object created but I want to know what the current cast of the object is (i.e.: is it still cast as a Derived class, or is it cast as a Base class?) Here is some pseudo code to show the example. Class Base .... End Class
1
2939
by: RYKLOU | last post by:
I am kinda new to php, but i do know what i am doing kinda, but i came across this error when i am trying to upload a file to my website. Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3714000 bytes) in /opt/lampp/htdocs/tutorials/php-mysql-tutorial/admin/image-gallery/library/functions.php on line 104 Platform: Ubuntu 8.04 LST (where i make my programs, and test them before i upload them), Using XAMPP for...
0
9731
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10405
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.