Click here to Skip to main content
15,887,214 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB-Access: Syntax error in INSERT INTO command Pin
Hristo-Bojilov4-Aug-09 7:34
Hristo-Bojilov4-Aug-09 7:34 
QuestionList all active windows Pin
NewbieDave3-Aug-09 10:02
NewbieDave3-Aug-09 10:02 
AnswerRe: List all active windows Pin
Christian Graus3-Aug-09 10:32
protectorChristian Graus3-Aug-09 10:32 
AnswerRe: List all active windows Pin
Dave Kreskowiak3-Aug-09 10:36
mveDave Kreskowiak3-Aug-09 10:36 
GeneralRe: List all active windows Pin
Christian Graus3-Aug-09 10:44
protectorChristian Graus3-Aug-09 10:44 
GeneralRe: List all active windows Pin
NewbieDave3-Aug-09 11:05
NewbieDave3-Aug-09 11:05 
GeneralRe: List all active windows Pin
Christian Graus3-Aug-09 11:17
protectorChristian Graus3-Aug-09 11:17 
QuestionObject disposed when trying to assign column width Pin
Hypermommy3-Aug-09 9:27
Hypermommy3-Aug-09 9:27 
Hi all,

I have a datagridview on a form. I have a subroutine called LoadReloadProcs that has this line in it

Me.dgvProcs.Columns(0).Width = Me.dgvProcs.Width * 0.75

This is the line where the error's happening. I'm getting an objectdisposed error.

Funny thing is, it'll run through this routine twice without reporting an error. It only reports the error when I come back from running a report. Also, if I put a breakpoint right there and use the immediate window to check the value of the width (i.e., ? dgvProcs.Columns(0).Width) the system tells me that it is 100. But if I try to assign a value to the width (i.e., in the immediate window dgvProcs.Columns(0).Width = 435) the system throws the object disposed error.

Why would I be able to request information of an object that is disposed? I shouldn't be able to, right? Or if it is not disposed, which being able to query the value of something suggests, why can't I assign a value to that property?

This has me really confused.

I've put the code for the procedure below... I don't see anything in there that helps me understand, but I figured one of y'all might. Also, I've searched for "dgvProcs.dispose" and just for ".dispose" and didn't find any relevant to dgvProcs.

 Private Sub LoadReloadProcList(ByVal strsql As String)
        Try
            'Me.Controls.Remove(dgvProcs)
            Dim daMyList = New SqlCeDataAdapter(strsql, myDB.cn)
            Dim dsMyList = New DataSet
            daMyList.Fill(dsMyList)
            Dim myBinding As New BindingSource
            myBinding.DataSource = dsMyList
            Me.dgvProcs.DataSource = myBinding
            Me.dgvProcs.DataMember = "Table"
            Me.dgvProcs.Columns(0).HeaderText = "Name"
            Me.dgvProcs.Columns(0).Width = Me.dgvProcs.Width * 0.75
            Me.dgvProcs.Columns(1).HeaderText = "Barcode"
            Me.dgvProcs.Columns(1).Width = Me.dgvProcs.Width * 0.15
            Me.Controls.Add(dgvProcs)
        Catch ex As Exception
#If DEBUG Then
            MsgBox(ex.Message)
#Else
            MsgBox("There was a problem gathering information on your previous procedures.  If this problem persists please contact your distributor.")
#End If
        End Try
    End Sub


Thanks in advance for any help you can give.

Denise "Hypermommy" Duggan

AnswerRe: Object disposed when trying to assign column width Pin
Dave Kreskowiak3-Aug-09 10:33
mveDave Kreskowiak3-Aug-09 10:33 
GeneralRe: Object disposed when trying to assign column width Pin
Hypermommy3-Aug-09 10:48
Hypermommy3-Aug-09 10:48 
GeneralRe: Object disposed when trying to assign column width Pin
Dave Kreskowiak3-Aug-09 16:21
mveDave Kreskowiak3-Aug-09 16:21 
GeneralRe: Object disposed when trying to assign column width Pin
Hypermommy3-Aug-09 23:03
Hypermommy3-Aug-09 23:03 
GeneralRe: Object disposed when trying to assign column width Pin
Luc Pattyn3-Aug-09 10:50
sitebuilderLuc Pattyn3-Aug-09 10:50 
QuestionCustomPanel: MenuStrip and Panel Pin
eusta3-Aug-09 9:13
eusta3-Aug-09 9:13 
AnswerRe: CustomPanel: MenuStrip and Panel Pin
Dave Kreskowiak3-Aug-09 10:30
mveDave Kreskowiak3-Aug-09 10:30 
GeneralRe: CustomPanel: MenuStrip and Panel Pin
eusta3-Aug-09 12:30
eusta3-Aug-09 12:30 
GeneralRe: CustomPanel: MenuStrip and Panel Pin
Dave Kreskowiak4-Aug-09 15:36
mveDave Kreskowiak4-Aug-09 15:36 
QuestionProblem Inserting Blob Datatype image into MySQL Pin
wr30283-Aug-09 7:45
wr30283-Aug-09 7:45 
AnswerRe: Problem Inserting Blob Datatype image into MySQL Pin
Dave Kreskowiak3-Aug-09 8:11
mveDave Kreskowiak3-Aug-09 8:11 
AnswerRe: Problem Inserting Blob Datatype image into MySQL Pin
Johan Hakkesteegt4-Aug-09 2:51
Johan Hakkesteegt4-Aug-09 2:51 
GeneralRe: Problem Inserting Blob Datatype image into MySQL Pin
wr30286-Aug-09 7:26
wr30286-Aug-09 7:26 
GeneralRe: Problem Inserting Blob Datatype image into MySQL Pin
Johan Hakkesteegt9-Aug-09 21:06
Johan Hakkesteegt9-Aug-09 21:06 
QuestionDatecs electronic cash register Pin
ivo753-Aug-09 6:56
ivo753-Aug-09 6:56 
AnswerRe: Datecs electronic cash register Pin
Luc Pattyn3-Aug-09 7:13
sitebuilderLuc Pattyn3-Aug-09 7:13 
AnswerRe: Datecs electronic cash register Pin
C Liv26-Oct-09 8:55
C Liv26-Oct-09 8:55 

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.