Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 1st, 2007, 06:04 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
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

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:13 AM.


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