|
I won't give you any code, but you could take a look at the WebRequest, WebClient and other related classes in the System.Net namespace. I think these will do what you want without having to open up a browser window.
|
|
|
|
|
I beleive there may be an article here for scraping web sites, that should get you started.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Dose anyone have any code that will allow me to change the backgound color of a Windows Mobile Toolbar in VB.
Thanks in advance as I know this code can only be wrote by the pro's.
Mark
|
|
|
|
|
Hi!
I'm trying to run a process that updates a zip/tax rate table.
The new tax rates are in a flat file. the table I need to update is a FoxPro free table indexed in country and zipcode fields.
Everything is working, but I have 45K+ records to update and after about 15% into the flat file the process it gets slooooow and gets slower and slower.
If I comment out the code that does search and just leave the code that goes through the flat file it takes about 30 seconds with the looks up and update it takes 30+ minutes and I can see the progress bar miving for first 15% and than it dies.... I think I am missing something here...
Here is what the code looks like:
m_conn = New OleDbConnection
m_conn.ConnectionString = "Provider=VFPOLEDB.1;" & _
"Data Source=" & g_app_options.processing_folder_path & "output\tax import;" & _
"Mode=ReadWrite|Share Deny None;" & _
"Collating Sequence=MACHINE;"
m_conn.Open()
Do While srTaxFile.EndOfStream = False
ado_command = New OleDb.OleDbCommand("SELECT ZIPCODE FROM zip WHERE country='001' AND ZIPCODE='" & taxRecord.field(cTaxRecord.RecordFieldIDs.ZipCode).Trim & "'", m_conn)
Dim sZipCode As String = ado_command.ExecuteScalar()
ado_command = New OleDb.OleDbCommand("UPDATE zip SET itaxr = " & taxRecord.field(cTaxRecord.RecordFieldIDs.SalesTaxRate).Trim & " WHERE zipcode='" & taxRecord.field(cTaxRecord.RecordFieldIDs.ZipCode).Trim & "'", m_conn)
ado_command.ExecuteNonQuery()
set_progress(srTaxFile.BaseStream.Length, srTaxFile.BaseStream.Position)
Loop
Its pretty simple, and I don't understand why it takes that long. This is running on a local drive.
If you can help or know what I'm missing, I would greatly appreciate it!
Thank you
ipokrov
|
|
|
|
|
Sorry but are you trying to update a table based on values from a flat file? Also, why are you selecting first if you know what you want to update?
You should also look at Transaction--this might make the process faster but I am sure there are better ways to do what you need to do. Can you please explain what you want to do, in plain English, without any code?
|
|
|
|
|
Hi,
Sorry I was not clear on what I'm trying to do.
In plain English, I have a comma delimited file with 45k+ records that contains zipcode and taxrate. I have a foxpro table that contains countrycode, zipcode and taxrate fields. Now I need to update each taxrate field in the table with value of taxrate field from the flat file. If the zipcode in taxrate table is not found I need to insert a new record. (that is why I have to lookup the zipcode first, I commented that code out and did not include it with my example.)
Thank you
ipokrov
|
|
|
|
|
|
FoxPro has indexing on it's tables using either IDX or CDX files, they'll have the same name as the .DBF file, but with a different extension; that is if there are any indexes on the table. Hopefully, there is an index on the zipcode field that can be used to speed up the look up queries. From my experience with OLEDB, it's generally faster to send as few commands as possible, so build a single query like:
select zipcode from zipcodes where zipcode in (... comma-separated list of zip codes ...)
This query of course will perform much better if there is an index on the zipcode field. It will give you the list of zipcodes that exist and need to be UPDATEd and ones that aren't in the result set will be INSERTs.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi All...
I am trying to load xml file with code mentioned below.
Dim XMLDc as XML.XMLDocument
XMLDc.Load(file.Path)
The problem in above is some file is getting uploaded where as xml file is not. It gives error 'Check the path' where all file is in same folder.
Say the path is "D:\Project" there is 3 files 1.xml, 2.xml, 3.xml
1.xml & 3.xml is getting uploaded and 2.xml is not. Generate Error 'Check the path and file should exist'
Please explain me the error and how to solve it...
Thanx in advance...
Shazz here to help you...
|
|
|
|
|
There is nothing that would cause that error for only one of the files that you described.
Shazz Rock wrote: Say the path is "D:\Project" there is 3 files 1.xml, 2.xml, 3.xml
Say what the real file names are instead. Also, where do you get the value for file.Path ?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a treeview in my form and when I inclrese the font of tree node it trims the text and do not increase the width of node. can anybody help me to sort this problem?. thanks in advance
Jagsir Singh (Sanam)
|
|
|
|
|
Increase the width of the TreeView control??
|
|
|
|
|
Hi, Everyone
I have me own web company called HoskWare i am looking for people to work with in building web browsers,
There are many great web browsers these days such as (Internet Explorer 8) - (Mozilla Firefox) - (Opera) and others
How ever i am trying to gather some people so we could make a web browser better that is better than them all put together.
If anyone is interested please contact me at:
MSN - ash-hosk@hotmail.co.uk
Thanks,
|
|
|
|
|
There is a jobs board on this site. Perhaps you could look for employees that way?
And if you do, you might also want to check your grammar. I don't like seeing simple gramatical errors on CVs I'm reviewing and it doesn't make such a good impression the other way around either.
113st4life wrote: I have me own web company
me --> my
113st4life wrote: i am looking
i --> I
113st4life wrote: web browsers,
Sentences end with a full stop, not a comma.
113st4life wrote: such as (Internet Explorer 8) - (Mozilla Firefox) - (Opera) and others
List items in prose a typically demarked by commas. Why are your list items in brackets? Finally, you've not put any puncuation at all to indicate the end of this sentence.
113st4life wrote: How ever
However is all one word.
113st4life wrote: i am
Again, the first person pronoun should be an upper case "I".
113st4life wrote: Thanks,
Your final sign off ends in a comma rather than a full stop.
I would have serious doubts about working for someone that cannot master the basics of communication.
|
|
|
|
|
Colin, you must have terrible trouble dealing with the Yank bastardisation of the language.
I was enlightened by your exception article, thanks.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I was looking for people to work with me not for a lesson!
I wasn't bothered about all that stuff you said its just a simple message!!
|
|
|
|
|
After long time I opened the Crystal Report
I got the following error message on the line that declared a ReportDocument. In addition, when I tried to open any Crystal Reports that I created in Visual Studio 2005, I got "Crystal Reports ActiveX Designer: Failed to open document." and "Microsoft Visual Studio: Failed to create the Crystal Query Engine." error message.
But before it working properly.
Plzzz Help me. Thanking you
|
|
|
|
|
Hello sir,
I want similar coding for treeview, where for linklabel is as follows.
[CODE]
Private Sub LinkLabel8_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel8.LinkClicked
WebBrowser1.Navigate(Application.StartupPath & "\source\test.html\")
End Sub
[/CODE]
|
|
|
|
|
I solved this, use file name in the tag with this extension and use the below coding
WebBrowser1.Navigate(Application.StartupPath & "\Source\" & e.Node.Tag)
IT Professional.
Work till you get it!
|
|
|
|
|
i need how to use crystal report with vb.i install crystal report 10.
|
|
|
|
|
Given that VB6 was a dead language when CR 10 was written, I doubt this is possible. either way, VB6 was rubbish even when it was supported, why are you using it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i need the code.how i use crystal report with visual basic 6.i need this code.
|
|
|
|
|
Don't double post just b/c you were incapable of thinking of an intelligent subject. Your posts can be edited.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I generally code for using VB.NET 2.0 and Visual Studio 2008.
I have a datagrid view bound to a dataset stored in xml file. I have implemented
several custom datagridviewtextboxcell controls - one which displays a box with a
colour beside a number. Another which displays a line of varying width beside it's
value.
These cells are drawn correctly when the value is changed, however when the form is
loaded and the datagriddview filled with data, all the cells are not painted. Only
when I select the cell by clicking does the cell repaint - this has been causing all
sorts of trouble.
I have attempted several workarounds, including a timer tick event hooked to the
invalidate method of the dgv and each displayed cell individually. Any ideas;
I probably have missed something simple.
The sample below is the custom control for the color cell - it will not work right
out of the box as it requires the Autodesk AutoCAD 2008 API
Public Class AcColorCell
Inherits DataGridViewTextBoxCell
<DebuggerNonUserCode()> _
Protected Overrides Sub Paint(ByVal graphics As Graphics, ByVal clipBounds As Rectangle, ByVal cellBounds As Rectangle, ByVal rowIndex As Integer, ByVal elementState As DataGridViewElementStates, ByVal value As Object, _
ByVal formattedValue As Object, ByVal errorText As String, ByVal cellStyle As DataGridViewCellStyle, ByVal advancedBorderStyle As DataGridViewAdvancedBorderStyle, ByVal paintParts As DataGridViewPaintParts)
'formattedValue = Nothing
MyBase.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts)
If Me.RowIndex < 0 Then Exit Sub
Dim ColorBoxRect As New Rectangle(cellBounds.X, cellBounds.Y, cellBounds.Width - 1, cellBounds.Height - 3)
ColorBoxRect.Inflate(-1, -1)
ColorBoxRect.Width = 18
ColorBoxRect.Offset(1, 0)
Dim TextBoxRect As New RectangleF(cellBounds.X + ColorBoxRect.Width + 4, _
cellBounds.Y, cellBounds.Width - 1, cellBounds.Height - 1)
Dim cellBackground As SolidBrush
If Not Me.Value Is DBNull.Value Then
If Me.Value <> 0 Then
Dim AcColor As Autodesk.AutoCAD.Colors.Color
Dim ColorValue As Short = CShort(Me.Value)
AcColor = Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci, ColorValue)
Dim r As Byte = AcColor.ColorValue.R
Dim g As Byte = AcColor.ColorValue.G
Dim b As Byte = AcColor.ColorValue.B
Dim Color As Drawing.Color = Drawing.Color.FromArgb(r, g, b)
cellBackground = New SolidBrush(Color)
graphics.FillRectangle(cellBackground, ColorBoxRect)
graphics.DrawRectangle(Pens.Black, ColorBoxRect)
graphics.DrawString(AcColor.ToString, cellStyle.Font, System.Drawing.Brushes.Black, TextBoxRect)
cellBackground.Dispose()
End If
End If
End Sub
End Class
Public Class AcColorColumn
Inherits DataGridViewColumn
Public Sub New()
MyBase.CellTemplate = New AcColorCell
End Sub
End Class
As below, the code for the lineweight control
Public Class AcLineweightCell
Inherits Windows.Forms.DataGridViewTextBoxCell
'skip the following while debugging
<DebuggerNonUserCode()> _
Protected Overrides Sub Paint(ByVal graphics As System.Drawing.Graphics, ByVal clipBounds As System.Drawing.Rectangle, ByVal cellBounds As System.Drawing.Rectangle, ByVal rowIndex As Integer, ByVal cellState As System.Windows.Forms.DataGridViewElementStates, ByVal value As Object, ByVal formattedValue As Object, ByVal errorText As String, ByVal cellStyle As System.Windows.Forms.DataGridViewCellStyle, ByVal advancedBorderStyle As System.Windows.Forms.DataGridViewAdvancedBorderStyle, ByVal paintParts As System.Windows.Forms.DataGridViewPaintParts)
MyBase.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts)
If Me.RowIndex < 0 Then Exit Sub
If Not Me.Value Is DBNull.Value Then
If Me.Value <> "" Then
'Get value of cell
Dim cellvalue As String = Me.Value
'Get AutoCAD lineweight of value
Dim lwconv As AcDb.LineWeightConverter = New AcDb.LineWeightConverter()
Dim lw As AcDb.LineWeight = Nothing
'Get the number of pixels that represent the lineweight
Dim px As Integer = GetLineweightPixel(cellvalue)
'Get rectangle where we can draw the lineweight
Dim lwrect As New Rectangle(cellBounds.X, cellBounds.Y, cellBounds.Width - 1, px)
lwrect.Width = 70
lwrect.Height = px
'Offset the rectangle from the top of the cell to center the lineweight display
lwrect.Offset(0, Math.Round(cellBounds.Height / 2) - CInt(Math.Round(px / 2)))
'Get rectangle where we can draw the cell value
'Dim txrect As New RectangleF(cellBounds.X, lwrect.Width + 4, cellBounds.Width - 1, cellBounds.Height - 1)
Dim newfont As New Font("Tahoma", 8.25, FontStyle.Regular, GraphicsUnit.Pixel)
Dim cellBackground As New SolidBrush(Color.Black)
graphics.FillRectangle(cellBackground, lwrect)
cellBackground.Dispose()
End If
End If
End Sub
black holes happened when God divided by zero
|
|
|
|
|
I suspect the problem is with the event you are using to paint the cells. I have not used custom controls in a gridview but I do paint individual cells accoring the data in the row. Explore RowPrePaint and there is a cell paint event that may work as well.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|