Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
|
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 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 August 1st, 2007, 06:04 PM
Authorized User
 
Join Date: Jan 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Option Strict On/passing a Datarow

Private Sub Table1DataGridView_CellMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArg s) Handles Table1DataGridView.CellMouseDoubleClick

 If Table1DataGridView.CurrentRow.DataBoundItem Is Nothing Then
        Me.Table1TableAdapter.Fill(Me.NewAppDBDataSet.Tabl e1)
 Else
        Me.TabControl1.SelectedTab = TabPage1
        txtboxID.Text = CType(Table1DataGridView.CurrentRow.DataBoundItem( "ID"), Integer)
        Table1TableAdapter.FillByID(NewAppDBDataSet.Table1 , CType(txtboxID.Text, Integer))
 End If
End Sub
-----------------------------------------------------------------------------------------------------
I am trying to pass data from DataGridView (Tab2) to a Data Entry Form (Tab1).
The row's column are: ID (the Key), First Name,
Last Name, DOB, Phone1, Phone2
If I have Option Strict On, this line: >
CType(Table1DataGridView.CurrentRow.DataBoundItem( "ID") will
cause exception saying, Option Strict On disallows late binding.
Do I have to worry about this or just let it go?
Is there an other solution to this problem?

The same problem occurs when trying to pass the key from one Form to another:

Private Sub Table2DataGridView_CellMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArg s) Handles Table2DataGridView.CellMouseDoubleClick
        entryform.Show()
        Dim i As Integer
        i = CType(Table2DataGridView.CurrentRow.DataBoundItem( "ID"), Integer)
        entryform.TextBox9.Text = i.ToString
        entryform.Table2TableAdapter.FillByCloth(entryform .HOEXDBDataSet.Table2, CType(entryform.TextBox9.Text, Integer))
        entryform.ToolStripStatusLabel1.Text = " Record is ready to modify"
        HOEX.HClothingForm.Close()
        Me.Close()
End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Strict on / Late Binding (p.535) irish_songbird BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 October 18th, 2006 12:51 PM
Page 154, revisited with Option Strict On irish_songbird BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 September 9th, 2006 07:24 PM
Option Strict Conversion Problem Little Shell VB.NET 2002/2003 Basics 1 July 17th, 2006 01:30 PM
"Option Strict On" with Microsoft Outlook Object ritag General .NET 0 January 25th, 2005 05:36 PM
Option Strict kevin777 VB.NET 2002/2003 Basics 2 October 10th, 2003 11:38 PM





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