473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Speed in VB 2005

I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a data
adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load the
data grid in vb 2005 it takes aroudn 20 seconds. IS there something that
could be causing this problem?
Aug 7 '06 #1
11 1381
Stephen,
>IS there something that could be causing this problem?
Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)
Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews.com ...
>I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a data
adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load the
data grid in vb 2005 it takes aroudn 20 seconds. IS there something that
could be causing this problem?

Aug 7 '06 #2
Hello Cor Ligthert [MVP],

*pokes* Cor, There was no VB6 mentioned. I know 2003 was a long time ago..

-Boo
Stephen,
>IS there something that could be causing this problem?
Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)

Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews.com ...
>I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a
data adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to
load the data grid in vb 2005 it takes aroudn 20 seconds. IS there
something that could be causing this problem?

Aug 7 '06 #3
"GhostInAK" <gh*******@gmail.comwrote in message
news:be**************************@news.microsoft.c om...
Hello Cor Ligthert [MVP],

*pokes* Cor, There was no VB6 mentioned. I know 2003 was a long time
ago..

-Boo
fwiw, I'd like to see any dotNet code run faster than a fully compiled and
optimized VB6 version of that same code. Heck... I'd like to see a dotNet
IDE that starts up in less time than it takes to make a cup of coffee. Oh
well... Quad core CPUs are coming out soon. Maybe then we'll see 386 era
performance from a dotNet app.

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Aug 7 '06 #4
Hi,

Boo, you are right, I don't know where I got that VB6..

Cor

"GhostInAK" <gh*******@gmail.comschreef in bericht
news:be**************************@news.microsoft.c om...
Hello Cor Ligthert [MVP],

*pokes* Cor, There was no VB6 mentioned. I know 2003 was a long time
ago..

-Boo
>Stephen,
>>IS there something that could be causing this problem?
Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)

Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews.co m...
>>I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a
data adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to
load the data grid in vb 2005 it takes aroudn 20 seconds. IS there
something that could be causing this problem?


Aug 7 '06 #5
Stephen,

Sorry for my misunderstanding.
Are you using exactly the same code, because this is the first time I read
about your problem.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O9**************@TK2MSFTNGP02.phx.gbl...
Stephen,
>>IS there something that could be causing this problem?

Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)
Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews.com ...
>>I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a data
adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load the
data grid in vb 2005 it takes aroudn 20 seconds. IS there something that
could be causing this problem?


Aug 7 '06 #6
All I did was install the VB 2005 and copy the source ccode from the VB.NET
(2003)

Private Sub PopulateStoreGrid()

Dim conn As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;Data
source=C:\BMActivityReporting.mdb;Persist Security Info=False")

Dim sSQL As String

If Mid(UserNoLink, 1, 1) = "0" Or Mid(UserNoLink, 1, 1) = "9" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE"

End If

If Mid(UserNoLink, 1, 1) = "1" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE BDRNo LIKE '" &
Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "2" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE RDSNo LIKE '" &
Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "3" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE MSNo LIKE '" &
Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "4" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE SDSNo LIKE '" &
Mid(UserNoLink, 1, 4) & "'"

End If

Dim sSQL2 As String = "select * from BENMOORETABLE"

conn.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter(sSQL, conn)

Dim da2 As New System.Data.OleDb.OleDbDataAdapter(sSQL2, conn)

Try

da.Fill(myDS, "BENMOOR1")

iCount = myDS.Tables("BENMOOR1").Rows.Count

da2.Fill(myDS, "BENMOOR2")

myDV = myDS.Tables("BENMOOR2").DefaultView

DataGrid1.DataSource = myDS

DataGrid1.DataMember = "BENMOOR1"

Dim irow As Integer

Dim icol As Integer

irow = 0

DataGrid1.Select(irow)

Dim sStore As String = CType(DataGrid1.Item(irow, 1), String)

myDV.Sort = "STORE_NUMBER"

Dim rowIndex As Integer = myDV.Find(sStore)

Me.LegalName1.Text = myDV(rowIndex)("LEGAL_NAME_LINE1").ToString()

Me.LegalName2.Text = myDV(rowIndex)("LEGAL_NAME_LINE2").ToString()

Me.StoreOwner.Text = myDV(rowIndex)("STORE_OWNER").ToString()

Me.PhoneNumber.Text = myDV(rowIndex)("PHONE_NUMBER").ToString()

Me.LegalName3.Text = myDV(rowIndex)("LEGAL_NAME_LINE3").ToString()

Me.LegalName4.Text = myDV(rowIndex)("LEGAL_NAME_LINE4").ToString()

Me.EMailAddress.Text = myDV(rowIndex)("E-MAIL_ADDRESS").ToString()

Fil_Name()

'UpdateScreen(irow)

Catch ex As Exception

MessageBox.Show("Failed to connect to data source")

Finally

conn.Close()

End Try

End Sub

Steve

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
Stephen,

Sorry for my misunderstanding.
Are you using exactly the same code, because this is the first time I read
about your problem.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O9**************@TK2MSFTNGP02.phx.gbl...
>Stephen,
>>>IS there something that could be causing this problem?

Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)
Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews.co m...
>>>I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a data
adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load the
data grid in vb 2005 it takes aroudn 20 seconds. IS there something that
could be causing this problem?



Aug 7 '06 #7
Stephen,

I don't know why it is,

I made this Test program
\\\
'Set in advance a reference to COM adox ext 2.x for dll and security

Public Class Main
Public Shared Sub Main()
'cleanup old databases
Dim catNewDB As New ADOX.Catalog
Dim fi As New IO.FileInfo("c:\db1.mdb")
If fi.Exists Then
If MessageBox.Show("Delete?", "Existing File db1.mdb", _
MessageBoxButtons.YesNo) = DialogResult.Yes Then
fi.Delete()
Else
Exit Sub
End If
End If
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data
Source=C:\db1.mdb")

Dim conn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;" & _
" Data Source=C:\db1.mdb;User Id=admin;Password=;")
Dim cmd As New OleDb.OleDbCommand("CREATE TABLE tester ( " & _
"Id int ," & _
"Whatever NVarchar(50)," & _
"CONSTRAINT [pk_Id] PRIMARY KEY (Id)) ", conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter("Select * from tester", conn)
da.Fill(ds)
For i As Integer = 0 To 40000
ds.Tables(0).LoadDataRow(New Object() {i, i.ToString}, False)
Next
Dim cmb As New OleDb.OleDbCommandBuilder(da)
da.Update(ds)
Dim ds2 As New DataSet
Dim start As Integer = Environment.TickCount
da.Fill(ds2)
MessageBox.Show((Environment.TickCount - start).ToString)
End Sub
End Class
///

The result is that the Fill part is about 7 times slower in VB2005 than in
VB2003

I will put this problem as well in another place.

It does not help you but you know that I had the same result.

Cor
"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:rJ******************************@giganews.com ...
All I did was install the VB 2005 and copy the source ccode from the
VB.NET (2003)

Private Sub PopulateStoreGrid()

Dim conn As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;Data
source=C:\BMActivityReporting.mdb;Persist Security Info=False")

Dim sSQL As String

If Mid(UserNoLink, 1, 1) = "0" Or Mid(UserNoLink, 1, 1) = "9" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE"

End If

If Mid(UserNoLink, 1, 1) = "1" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE BDRNo LIKE '"
& Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "2" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE RDSNo LIKE '"
& Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "3" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE MSNo LIKE '"
& Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "4" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE SDSNo LIKE '"
& Mid(UserNoLink, 1, 4) & "'"

End If

Dim sSQL2 As String = "select * from BENMOORETABLE"

conn.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter(sSQL, conn)

Dim da2 As New System.Data.OleDb.OleDbDataAdapter(sSQL2, conn)

Try

da.Fill(myDS, "BENMOOR1")

iCount = myDS.Tables("BENMOOR1").Rows.Count

da2.Fill(myDS, "BENMOOR2")

myDV = myDS.Tables("BENMOOR2").DefaultView

DataGrid1.DataSource = myDS

DataGrid1.DataMember = "BENMOOR1"

Dim irow As Integer

Dim icol As Integer

irow = 0

DataGrid1.Select(irow)

Dim sStore As String = CType(DataGrid1.Item(irow, 1), String)

myDV.Sort = "STORE_NUMBER"

Dim rowIndex As Integer = myDV.Find(sStore)

Me.LegalName1.Text = myDV(rowIndex)("LEGAL_NAME_LINE1").ToString()

Me.LegalName2.Text = myDV(rowIndex)("LEGAL_NAME_LINE2").ToString()

Me.StoreOwner.Text = myDV(rowIndex)("STORE_OWNER").ToString()

Me.PhoneNumber.Text = myDV(rowIndex)("PHONE_NUMBER").ToString()

Me.LegalName3.Text = myDV(rowIndex)("LEGAL_NAME_LINE3").ToString()

Me.LegalName4.Text = myDV(rowIndex)("LEGAL_NAME_LINE4").ToString()

Me.EMailAddress.Text = myDV(rowIndex)("E-MAIL_ADDRESS").ToString()

Fil_Name()

'UpdateScreen(irow)

Catch ex As Exception

MessageBox.Show("Failed to connect to data source")

Finally

conn.Close()

End Try

End Sub

Steve

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
>Stephen,

Sorry for my misunderstanding.
Are you using exactly the same code, because this is the first time I
read about your problem.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O9**************@TK2MSFTNGP02.phx.gbl...
>>Stephen,

IS there something that could be causing this problem?

Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)
Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews.c om...
I upgraded from VB 2003 to VB 2005.

I have a 4000 record table in Access that I'm using oleDB to do a data
adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load
the data grid in vb 2005 it takes aroudn 20 seconds. IS there something
that could be causing this problem?



Aug 8 '06 #8
Cor,

Thanks for the quick program and test. I'll need to go back to using vb.NET
for now until this can get resolved; what are the procedures for finding out
when this gets fixed?

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:O5**************@TK2MSFTNGP06.phx.gbl...
Stephen,

I don't know why it is,

I made this Test program
\\\
'Set in advance a reference to COM adox ext 2.x for dll and security

Public Class Main
Public Shared Sub Main()
'cleanup old databases
Dim catNewDB As New ADOX.Catalog
Dim fi As New IO.FileInfo("c:\db1.mdb")
If fi.Exists Then
If MessageBox.Show("Delete?", "Existing File db1.mdb", _
MessageBoxButtons.YesNo) = DialogResult.Yes Then
fi.Delete()
Else
Exit Sub
End If
End If
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data
Source=C:\db1.mdb")

Dim conn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;" & _
" Data Source=C:\db1.mdb;User Id=admin;Password=;")
Dim cmd As New OleDb.OleDbCommand("CREATE TABLE tester ( " & _
"Id int ," & _
"Whatever NVarchar(50)," & _
"CONSTRAINT [pk_Id] PRIMARY KEY (Id)) ", conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter("Select * from tester", conn)
da.Fill(ds)
For i As Integer = 0 To 40000
ds.Tables(0).LoadDataRow(New Object() {i, i.ToString}, False)
Next
Dim cmb As New OleDb.OleDbCommandBuilder(da)
da.Update(ds)
Dim ds2 As New DataSet
Dim start As Integer = Environment.TickCount
da.Fill(ds2)
MessageBox.Show((Environment.TickCount - start).ToString)
End Sub
End Class
///

The result is that the Fill part is about 7 times slower in VB2005 than in
VB2003

I will put this problem as well in another place.

It does not help you but you know that I had the same result.

Cor
"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:rJ******************************@giganews.com ...
>All I did was install the VB 2005 and copy the source ccode from the
VB.NET (2003)

Private Sub PopulateStoreGrid()

Dim conn As New
System.Data.OleDb.OleDbConnection("Provider=Micro soft.Jet.OLEDB.4.0;Data
source=C:\BMActivityReporting.mdb;Persist Security Info=False")

Dim sSQL As String

If Mid(UserNoLink, 1, 1) = "0" Or Mid(UserNoLink, 1, 1) = "9" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE"

End If

If Mid(UserNoLink, 1, 1) = "1" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE BDRNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "2" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE RDSNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "3" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE MSNo LIKE '"
& Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "4" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE SDSNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

Dim sSQL2 As String = "select * from BENMOORETABLE"

conn.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter(sSQL, conn)

Dim da2 As New System.Data.OleDb.OleDbDataAdapter(sSQL2, conn)

Try

da.Fill(myDS, "BENMOOR1")

iCount = myDS.Tables("BENMOOR1").Rows.Count

da2.Fill(myDS, "BENMOOR2")

myDV = myDS.Tables("BENMOOR2").DefaultView

DataGrid1.DataSource = myDS

DataGrid1.DataMember = "BENMOOR1"

Dim irow As Integer

Dim icol As Integer

irow = 0

DataGrid1.Select(irow)

Dim sStore As String = CType(DataGrid1.Item(irow, 1), String)

myDV.Sort = "STORE_NUMBER"

Dim rowIndex As Integer = myDV.Find(sStore)

Me.LegalName1.Text = myDV(rowIndex)("LEGAL_NAME_LINE1").ToString()

Me.LegalName2.Text = myDV(rowIndex)("LEGAL_NAME_LINE2").ToString()

Me.StoreOwner.Text = myDV(rowIndex)("STORE_OWNER").ToString()

Me.PhoneNumber.Text = myDV(rowIndex)("PHONE_NUMBER").ToString()

Me.LegalName3.Text = myDV(rowIndex)("LEGAL_NAME_LINE3").ToString()

Me.LegalName4.Text = myDV(rowIndex)("LEGAL_NAME_LINE4").ToString()

Me.EMailAddress.Text = myDV(rowIndex)("E-MAIL_ADDRESS").ToString()

Fil_Name()

'UpdateScreen(irow)

Catch ex As Exception

MessageBox.Show("Failed to connect to data source")

Finally

conn.Close()

End Try

End Sub

Steve

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
>>Stephen,

Sorry for my misunderstanding.
Are you using exactly the same code, because this is the first time I
read about your problem.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O9**************@TK2MSFTNGP02.phx.gbl...
Stephen,

>IS there something that could be causing this problem?

Yes a lot, but in most cases (not all) VBNet is faster.

Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)
Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews. com...
>I upgraded from VB 2003 to VB 2005.
>
I have a 4000 record table in Access that I'm using oleDB to do a data
adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load
the data grid in vb 2005 it takes aroudn 20 seconds. IS there
something that could be causing this problem?
>




Aug 8 '06 #9
On Mon, 7 Aug 2006 14:55:17 -0500, "Stephen Plotnick" <sp*******@groupcbf.comwrote:

¤ I upgraded from VB 2003 to VB 2005.
¤
¤ I have a 4000 record table in Access that I'm using oleDB to do a data
¤ adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to load the
¤ data grid in vb 2005 it takes aroudn 20 seconds. IS there something that
¤ could be causing this problem?
¤

Aren't you using some type of paging mechanism for the DataGrid. Querying for and loading 4,000 rows
at one time is really not a very good idea.
Paul
~~~~
Microsoft MVP (Visual Basic)
Aug 8 '06 #10
Stephen,

I don't know if the method with the datareader will help you.

http://msdn2.microsoft.com/en-us/lib...able.load.aspx

I did not test that.

Cor

"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:X8******************************@giganews.com ...
Cor,

Thanks for the quick program and test. I'll need to go back to using
vb.NET for now until this can get resolved; what are the procedures for
finding out when this gets fixed?

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:O5**************@TK2MSFTNGP06.phx.gbl...
>Stephen,

I don't know why it is,

I made this Test program
\\\
'Set in advance a reference to COM adox ext 2.x for dll and security

Public Class Main
Public Shared Sub Main()
'cleanup old databases
Dim catNewDB As New ADOX.Catalog
Dim fi As New IO.FileInfo("c:\db1.mdb")
If fi.Exists Then
If MessageBox.Show("Delete?", "Existing File db1.mdb", _
MessageBoxButtons.YesNo) = DialogResult.Yes Then
fi.Delete()
Else
Exit Sub
End If
End If
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data
Source=C:\db1.mdb")

Dim conn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLE DB.4.0;" & _
" Data Source=C:\db1.mdb;User Id=admin;Password=;")
Dim cmd As New OleDb.OleDbCommand("CREATE TABLE tester ( " & _
"Id int ," & _
"Whatever NVarchar(50)," & _
"CONSTRAINT [pk_Id] PRIMARY KEY (Id)) ", conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter("Select * from tester", conn)
da.Fill(ds)
For i As Integer = 0 To 40000
ds.Tables(0).LoadDataRow(New Object() {i, i.ToString}, False)
Next
Dim cmb As New OleDb.OleDbCommandBuilder(da)
da.Update(ds)
Dim ds2 As New DataSet
Dim start As Integer = Environment.TickCount
da.Fill(ds2)
MessageBox.Show((Environment.TickCount - start).ToString)
End Sub
End Class
///

The result is that the Fill part is about 7 times slower in VB2005 than
in VB2003

I will put this problem as well in another place.

It does not help you but you know that I had the same result.

Cor
"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:rJ******************************@giganews.co m...
>>All I did was install the VB 2005 and copy the source ccode from the
VB.NET (2003)

Private Sub PopulateStoreGrid()

Dim conn As New
System.Data.OleDb.OleDbConnection("Provider=Micr osoft.Jet.OLEDB.4.0;Data
source=C:\BMActivityReporting.mdb;Persist Security Info=False")

Dim sSQL As String

If Mid(UserNoLink, 1, 1) = "0" Or Mid(UserNoLink, 1, 1) = "9" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE"

End If

If Mid(UserNoLink, 1, 1) = "1" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE BDRNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "2" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE RDSNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "3" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE MSNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

If Mid(UserNoLink, 1, 1) = "4" Then

sSQL = "select BM_NUMBER, STORE_NUMBER, STORE, SHIP_ADDRESS1 as ADDRESS,
SHIP_CITY as CITY, SHIP_ST as STATE from BENMOORETABLE WHERE SDSNo LIKE
'" & Mid(UserNoLink, 1, 4) & "'"

End If

Dim sSQL2 As String = "select * from BENMOORETABLE"

conn.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter(sSQL, conn)

Dim da2 As New System.Data.OleDb.OleDbDataAdapter(sSQL2, conn)

Try

da.Fill(myDS, "BENMOOR1")

iCount = myDS.Tables("BENMOOR1").Rows.Count

da2.Fill(myDS, "BENMOOR2")

myDV = myDS.Tables("BENMOOR2").DefaultView

DataGrid1.DataSource = myDS

DataGrid1.DataMember = "BENMOOR1"

Dim irow As Integer

Dim icol As Integer

irow = 0

DataGrid1.Select(irow)

Dim sStore As String = CType(DataGrid1.Item(irow, 1), String)

myDV.Sort = "STORE_NUMBER"

Dim rowIndex As Integer = myDV.Find(sStore)

Me.LegalName1.Text = myDV(rowIndex)("LEGAL_NAME_LINE1").ToString()

Me.LegalName2.Text = myDV(rowIndex)("LEGAL_NAME_LINE2").ToString()

Me.StoreOwner.Text = myDV(rowIndex)("STORE_OWNER").ToString()

Me.PhoneNumber.Text = myDV(rowIndex)("PHONE_NUMBER").ToString()

Me.LegalName3.Text = myDV(rowIndex)("LEGAL_NAME_LINE3").ToString()

Me.LegalName4.Text = myDV(rowIndex)("LEGAL_NAME_LINE4").ToString()

Me.EMailAddress.Text = myDV(rowIndex)("E-MAIL_ADDRESS").ToString()

Fil_Name()

'UpdateScreen(irow)

Catch ex As Exception

MessageBox.Show("Failed to connect to data source")

Finally

conn.Close()

End Try

End Sub

Steve

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
Stephen,

Sorry for my misunderstanding.
Are you using exactly the same code, because this is the first time I
read about your problem.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O9**************@TK2MSFTNGP02.phx.gbl...
Stephen,
>
>>IS there something that could be causing this problem?
>
Yes a lot, but in most cases (not all) VBNet is faster.
>
Can you show a piece of your code that does the fill of the datagrid?
(only VBNet although I am curious how you use that datagrid in VB6)
>
>
Cor
>
"Stephen Plotnick" <sp*******@groupcbf.comschreef in bericht
news:Nd******************************@giganews .com...
>>I upgraded from VB 2003 to VB 2005.
>>
>I have a 4000 record table in Access that I'm using oleDB to do a
>data adapter fill to a Data Grid. In VB.2003 it takes 2-3 seconds to
>load the data grid in vb 2005 it takes aroudn 20 seconds. IS there
>something that could be causing this problem?
>>
>
>




Aug 8 '06 #11

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.comwrote in message news:OO*************@TK2MSFTNGP06.phx.gbl...
"GhostInAK" <gh*******@gmail.comwrote in message
fwiw, I'd like to see any dotNet code run faster than a fully compiled and
optimized VB6 version of that same code. Heck... I'd like to see a dotNet
IDE that starts up in less time than it takes to make a cup of coffee. Oh
well... Quad core CPUs are coming out soon. Maybe then we'll see 386 era
performance from a dotNet app.

--
Ken Halter -

I'm having a hard time trying to figure out if you like .net or not Ken...


--
Posted via a free Usenet account from http://www.teranews.com

Aug 8 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: I.V. Aprameya Rao | last post by:
Hi I have to implement a flat file dbms. The basic condition is that relations will be given in files and i will have to run certain select project join queries on those relations. Can...
23
by: Mark Dickinson | last post by:
I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly,...
60
by: Neil | last post by:
I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL 7 back end. The view is scrolling very slowly. However, if I open the view in an ADP file, it scrolls quickly. I...
3
by: Arun Kumar | last post by:
Hi I am new to .NET. I have VS.NET 2003 and VS.NET 2005 Beta 2 Installed on my PC. I created a Windows Application which uses COM object. Its a simple test. When I Build the application on VS...
7
by: Brian Henry | last post by:
is there any speed diffrences between doing Ctype or directcast? I know about the inherite diffrences, but process usage time wise, does one take up more cycles then the other? thanks
0
by: Jeff Gaines | last post by:
I have just installed VS 2005 (MSDN version) and it's brought my network to its knees. All my data is on a server with a 100 Mbps connection. I was getting messages that the share couldn't be...
3
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on our 100Mb/s LAN. Simply copying the file, I get...
16
by: byteschreck | last post by:
I recently switched temporarily from C# to VB.NET to see what the differences are. To my surprise I am *much* faster with VB.NET. I don't know why, pressing the shift key to capitalize letters...
1
by: =?Utf-8?B?TWFyayBT?= | last post by:
I have an application that consists of a managed C++ wrapper around an unmanaged C++ "engine" that performs a very processor intensive task. In the application I create two instances of the...
5
by: Ben | last post by:
We recently upgraded our MS SQL Server 2000 to 2005. Here is what we did: 1. Perform backup of the database from the old server. 2. Created a blank database in the new server. 3. Restored the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.