Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2007, 11:34 AM
Authorized User
 
Join Date: Dec 2006
Posts: 43
Thanks: 4
Thanked 0 Times in 0 Posts
Send a message via MSN to Yasho
Default HELP NEEDED

I am using VB.net 2003 and access database
What I am trying to do is load some data from 2 different table in a list view and then save listview data in a 3rd table
I am getting an error
[u]Cast from string "TaskID" to type "Single" is not valid</u>
Task ID is a Numbet declared type Single in Accesss DataBase

here is my code

Sub Meupdate()

        Dim newRow As dstransection.tblRentalOutRow
        Dim Item As ListViewItem
        Dim result As String

'Updating the MS ACCESS table EmployeeTask from listview

        Try

            newRow = Dstransection1.tblRentalOut.NewRow()
            newRow("EmployeeID") = txtEmpID.Text

'TaskID is a number type single in Access DataBase

            newRow("TaskID") = lvwRental.Columns(CSng("TaskID"))
            newRow("DateFinished") = Today
            newRow("DateStarted") = lvwRental.Columns("DateStarted")


  Catch except As Exception
            MessageBox.Show(except.Message, except.GetType.ToString())
        End Try



    End Sub

Will one of you experts to help this beginer programmer.

yvk
__________________
yvk
 
Old January 29th, 2007, 08:13 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default

Check the value of the following in your program:

newRow("TaskID") = lvwRental.Columns(CSng("TaskID"))

My guess would be that the lvwRental.Column is an empty string which cannot be typed as a Single numeric value.




Best Regards,
Earl Francis





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed ramabharti Javascript How-To 1 December 7th, 2006 06:42 AM
Help needed rrvinod ADO.NET 0 October 5th, 2006 09:44 AM
help needed! paquito Beginning PHP 2 November 16th, 2005 11:51 AM
A Little help needed matthew01 ASP.NET 1.0 and 1.1 Basics 3 November 9th, 2005 11:29 AM
help needed kfarooq Java Databases 1 June 27th, 2003 05:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.