Click here to Skip to main content
16,007,858 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Application in languages other than english Pin
Andreas_Jonsson20-Apr-08 8:21
Andreas_Jonsson20-Apr-08 8:21 
Questioni need cod record sound in database access [modified] Pin
sarahsoso19-Apr-08 9:57
sarahsoso19-Apr-08 9:57 
GeneralRe: i need cod record sound in database access Pin
Dave Kreskowiak19-Apr-08 12:32
mveDave Kreskowiak19-Apr-08 12:32 
GeneralRe: i need cod record sound in database access Pin
leckey19-Apr-08 14:51
leckey19-Apr-08 14:51 
Questioni want find a list of form of my application in code? Pin
combo_ci19-Apr-08 6:00
combo_ci19-Apr-08 6:00 
AnswerCross post... Ignore this thread. Pin
Dave Kreskowiak19-Apr-08 7:16
mveDave Kreskowiak19-Apr-08 7:16 
QuestionSaving a file Pin
Zak Hansen19-Apr-08 2:20
Zak Hansen19-Apr-08 2:20 
GeneralRe: Saving a file Pin
Luc Pattyn19-Apr-08 2:55
sitebuilderLuc Pattyn19-Apr-08 2:55 
QuestionProblems with TCPClient and TCPListener [modified] Pin
softwarejaeger19-Apr-08 0:11
softwarejaeger19-Apr-08 0:11 
GeneralRe: Problems with TCPClient and TCPListener Pin
Rob Smiley19-Apr-08 0:32
Rob Smiley19-Apr-08 0:32 
GeneralRe: Problems with TCPClient and TCPListener [modified] Pin
softwarejaeger19-Apr-08 1:58
softwarejaeger19-Apr-08 1:58 
GeneralRe: Problems with TCPClient and TCPListener Pin
Rob Smiley19-Apr-08 2:31
Rob Smiley19-Apr-08 2:31 
GeneralRe: Problems with TCPClient and TCPListener Pin
softwarejaeger20-Apr-08 19:51
softwarejaeger20-Apr-08 19:51 
GeneralSending information between apps: code Pin
Jimilybibilybob18-Apr-08 23:17
Jimilybibilybob18-Apr-08 23:17 
GeneralRe: Sending information between apps: code Pin
Dave Kreskowiak19-Apr-08 4:22
mveDave Kreskowiak19-Apr-08 4:22 
GeneralDataRow Cast Exception Error Pin
Member 323293418-Apr-08 21:19
Member 323293418-Apr-08 21:19 
Hello,

I am trying to do the following:
Private Sub GetDepartmentTest()
        Dim myDataset As New DataSet("Databasename")

        'load data from xml file
        myDataset.ReadXml("C:\XmlDatabase\Data.xml")

        Dim myDataRow As DataRow = myDataset.Tables("Department").Rows(0)

        ' the next line gives an error
        Dim myDepartment As Department= myDataRow

        MsgBox(myDepartment .Name)
    End Sub

Class Department
        Inherits Data.DataRow

        Public Sub New(ByVal builder As DataRowBuilder)
            MyBase.New(builder)
        End Sub

        Property Name() As String
            Get
                Return Item("name")
            End Get
            Set(ByVal value As String)
                Item("name") = value
            End Set
        End Property
    End Class


But I keep getting an error:
<br />
System.InvalidCastException was unhandled<br />
Message="Unable to cast object of type 'System.Data.DataRow' to type 'Department'." <br />


The error occurs on this line:
Dim myDepartment As Department= myDataRow

Can someone tell me what I do wrong?
GeneralRe: DataRow Cast Exception Error Pin
Mycroft Holmes18-Apr-08 22:37
professionalMycroft Holmes18-Apr-08 22:37 
GeneralNeed help in Vb.net Pin
RameshMorasa18-Apr-08 21:16
RameshMorasa18-Apr-08 21:16 
GeneralRe: Need help in Vb.net Pin
Rajesh Anuhya18-Apr-08 21:27
professionalRajesh Anuhya18-Apr-08 21:27 
GeneralRe: Need help in Vb.net Pin
leckey19-Apr-08 5:11
leckey19-Apr-08 5:11 
GeneralOn screen keyboard code Pin
Jimilybibilybob18-Apr-08 11:28
Jimilybibilybob18-Apr-08 11:28 
GeneralRe: On screen keyboard code Pin
Christian Graus18-Apr-08 12:39
protectorChristian Graus18-Apr-08 12:39 
GeneralRe: On screen keyboard code Pin
Mycroft Holmes18-Apr-08 22:39
professionalMycroft Holmes18-Apr-08 22:39 
GeneralRe: On screen keyboard code Pin
Jimilybibilybob18-Apr-08 23:13
Jimilybibilybob18-Apr-08 23:13 
GeneralRe: On screen keyboard code Pin
Dave Kreskowiak19-Apr-08 4:14
mveDave Kreskowiak19-Apr-08 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.