.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 18th, 2003, 04:32 PM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 6
What does this ERROR mean ?

Une exception non gérée du type 'System.InvalidCastException' s'est produite dans Projet_DTI.exe

Informations supplémentaires_: Le cast spécifié n'est pas valide.

sorry I am working on a french station !
If I translate it, it's mean

An exception have not been managed (taked care of) of type 'System.InvalidCastException'

Additionnal information : The specific cas is not valid.

What does that mean ?

here is the code where that happens
Code:
            For Each objRue In cboRue.Items
                i = i + 1
                drDataRowRue = FindRue(objRue, nomVille, dsDataSetRue)
                tabNoRue(i) = drDataRowRue.Item("norue")
            Next


and the error happens on the third line (drdatarowrue =....)

and here is what is findrue
Code:
    Function FindRue(ByVal NomRue As String, ByVal NomVille As String, ByRef DataSetRue As DataSet) As _
                                                                                                DataRow
        'Déclare une ligne dans la table des villes
        Dim drDataRowVille As DataRow
        'Déclare une ligne dans la table RUE
        Dim drDataRowRue As DataRow = Nothing
        'Déclare une ligne temporaire dans la table RUE
        Dim drDataRowRueTEMP As DataRow
        drDataRowVille = FindVille(NomVille, frmItems.DataSetVille1)
        If Not (drDataRowVille Is Nothing) Then
            For Each drDataRowRueTEMP In DataSetRue.Tables("Rue").Rows
                If CStr(drDataRowRueTEMP.Item("rue")).ToUpper = NomRue.ToUpper And _
                        drDataRowRueTEMP.Item("noVille") = drDataRowVille.Item("noVille") Then
                    drDataRowRue = drDataRowRueTEMP
                    Exit For
                End If
            Next
        End If
        Return drDataRowRue
    End Function
__________________

Last edited by Watever : September 18th, 2003 at 04:45 PM.

Reply With Quote
  #2  
Old September 19th, 2003, 01:50 AM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
that's about the same error as a data type mismatch. it could be because objRue is an object (i assume) and you are passing it to a function that requries a string.

try:
Code:
drDataRowRue = FindRue(CStr(objRue), nomVille, dsDataSetRue)
__________________
Programmer's Corner

Reply With Quote
  #3  
Old September 23rd, 2003, 09:23 AM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 6
I have found my stupid error. But wanted to tell you the error wasn't in the objRue, I checked it out. An string is an object so there is no error on it, it's just hierarchie.

the error came from the third line.
Code:
For Each objRue In cboRue.Items
                i = i + 1
                drDataRowRue = FindRue(CStr(objRue), nomVille, dsDataSetRue)
                [b]tabNoRue(i) = drDataRowRue.Item("norue")[/rue]
            Next


that's where the error is part from. the real bug was created from different error, one of them was the table.

Last edited by Watever : September 23rd, 2003 at 09:33 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > What does this ERROR mean ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT