Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 October 5th, 2006, 05:13 AM
Authorized User
 
Join Date: Jun 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default Urgent

HI all,

I have developed one desktop application.In this application i have one form and module.My start up page is module and form object is created in module and set show property in module.I have one datagrid on my form.My application is running properly without using thread.But when i use thread,I got error "Controls created on one thread cannot be parented to a control on a different thread."

 Dim grid As New Thread(AddressOf BindGrid)
        grid.Start()
This thread is written in form_load event.

 Public Sub BindGrid()
        'FillGridColumn()
        SetGridProperty()
        Dim dtData As New DataTable
        dtData = CreateTable()
        CreateTable()
        dg_Records.DataSource = dtData
        dg_Records.Visible = True
    End Sub

but when i debug my application,i got an error on dg_Records.DataSource = dtData
what i do?Any other solution to write thread in vb.net?Pls help me.It's urgent.

Thanx
monika




 
Old October 5th, 2006, 07:11 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First you have posted u'r query in wrong forum, this is for asp.net.
Now declare Datatable at form class level and create a function to set DataSource property to DataTable. and call that function from your thread.
Hope this will help.

Bijgupt





Similar Threads
Thread Thread Starter Forum Replies Last Post
urgent deb_kareng ASP.NET 2.0 Professional 1 August 13th, 2007 07:29 AM
it's urgent deb_kareng ASP.NET 2.0 Professional 3 August 7th, 2007 07:40 AM
urgent help yash_coolbuddy_forindia BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 May 7th, 2007 08:40 AM
urgent???????????? nsr35 Beginning VB 6 1 October 3rd, 2005 10:57 AM
urgent ??????????????? nsr35 Pro VB Databases 0 October 3rd, 2005 04:53 AM





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