rowchanged event not firing on fill method

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

It appears that the rowchanged event is not fired by the fill method, but it
is fired by the update method. If this is correct, what event is fired by
the fill method?

Thanks for any help

Bernie Yaeger
 
Hi Miha,

You are one of the sharpest people working with ADO .Net, but you are
wrong - it doesn't fire on .fill.

Which brings me back to my original question - what event can I hook up to
to track the .fill action?

Regards,

Bernie
 
Hi Bernie,

Bernie Yaeger said:
Hi Miha,

You are one of the sharpest people working with ADO .Net, but you are
wrong - it doesn't fire on .fill.

Which brings me back to my original question - what event can I hook up to
to track the .fill action?

AFAIK it fires. Can you show me your code?
 
Hi Miha,

Here's the relevant code. In the rowchanged event I have a messagebox that
never shows:
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1

Me.SqlSelectCommand1.CommandText = "SELECT bipad, issuecode, imcacct, title,
brname, ponumber, draw, sold, preturn, r" & _

"return, shortage, net, efficiency, billed, shipdt, uprice, ptype,
posstatus, vflag FROM hi" & _

"std WHERE (shipdt >= " & Chr(39) & gl_browsestartdate & Chr(39) & ")"

Me.SqlSelectCommand1.Connection = Me.SqlConnection1

Me.SqlDataAdapter1.Fill(Me.Histdds1)

Dim dt As DataTable

dt = Histdds1.Tables(0)

AddHandler dt.RowChanged, New DataRowChangeEventHandler(AddressOf
DataTableRow_Changed)

Public Sub DataTableRow_Changed(ByVal Sender As Object, ByVal e As
System.Data.DataRowChangeEventArgs)

' glf_icount is a class variable - i use 'glf_' for 'global to this form'

MessageBox.Show("here")

glf_icount += 1

If glf_icount > (pbar.Maximum / 100) Then

glf_icount = 0

pbar.PerformStep()

Application.DoEvents()

End If



End Sub
 
Hi Miha,

You will probably find the error - David Foster did in another thread - I
was calling addhandler 'after' the fill method; I should have called it
before. Only wasted some of your time and hours of mine - sorry, and, as
always, tx.

Bernie
 
Hi Bernie,

I think it is almost impossible to succeed in that progressbar.

That not because of the reading of the data, but because that for the use of
a progressbar you don't need only the progress, but also the lenght of the
total steps of the progress (all your rows).

I was put on the wrong thoughts because that event from the datatable
change.

Cor
 
Hi Cor,

No, I have it solved! I do this first:
Dim cmd As SqlCommand = oconn.CreateCommand()

cmd.CommandText = "select count(*) from histd WHERE (shipdt >= " & Chr(39) &
gl_browsestartdate & Chr(39) & ")"

Dim rows As Integer = CInt(cmd.ExecuteScalar)

Now rows is the total and this command executes in a second or two, even
when the ultimate fill will include a million rows.

Bernie
 
Back
Top