|
No because you're still on the UI thread.
The "work" should be done on a sperate thread to leave the UI thread to, well, update UI things. Look into awaiting Tasks[^] or using a BackgroundWorker[^] to move the "work" off of the UI thread.
|
|
|
|
|
i want read html data using the vbscript
|
|
|
|
|
OK, permission granted! Please, proceed.
Or did you forget to specify what you're having a problem with?
|
|
|
|
|
I want to know the script to read the html data using vb script
|
|
|
|
|
this the html code
i want to retrive 27 value from this
--Name-Failed Tests-Successful Tests-Total Tests-Success %---Payment_HealthCheck/Payment_HealthCheck.tst-27-90-117-76%-
|
|
|
|
|
So you want someone to write the code for you? Not going to happen. We don't get paid to do your work.
This[^] is where you start researching how to do web scraping in VBScript.
|
|
|
|
|
Some VB6 programs will not run in Windows 7. When I try a message appears stating "Object Library Not Registered.
What do I have to do to correct the problem?
|
|
|
|
|
Install the libraries that your VB6 code is using.
These are usually control libraries.
|
|
|
|
|
I reinstalled them but the program will not run.
|
|
|
|
|
|
I think you have to do this in your forms so the platform is recognized. Remember that SYSWOW is also going to be a location that windows will decide to run in.
#If Win64 Then
#ElseIf Win32 Then
#Else
#End If
|
|
|
|
|
Hello VB Code people,
I'm having trouble finding the correct code that when I select or multi-select an item from a list box in a Word 2007 userform and then press a button. I want it to create a table in Word 2007 from the items that I've selected in the list box. The userform gets populated from Excel and it works fine. Below is the VB Code for populating the userform with Excel data. Any help is greatly appreciated. Thank you
Private Sub Userform_Initialize()
Dim strOffice As String
Dim i As Long
Dim db As DAO.Database
Dim rs As DAO.Recordset
strOffice = "Test"
Set db = OpenDatabase("C:Testdata.xlsx", False, False, "Excel 12.0; IMEX=1;")
Set rs = db.OpenRecordset("SELECT * FROM `Test`")
ListBox1.ColumnCount = rs.Fields.Count
With rs
.MoveLast
i = .RecordCount
.MoveFirst
End With
ListBox1.Column = rs.GetRows(i)
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
lbl_Exit:
Exit Sub
End Sub
|
|
|
|
|
Hello folks,
This issue has me baffled for a few days now. I have tried everything I can possibly think of but nothing seems to work.
In this project, which is just for practice purposes, I insert data to SQL via a small form of three TextBoxes. This works fine and the data is inserted fine. The data is then shown in ComboBox Dropdown where, by selecting a value, shows related content in three other textboxes. This all works fine also.
I can delete content from a third form, which has a DataGridView and by selecting a row and clicking a button, the data is removed from SQL and also the DataGrid updates itself immediately.
The issue I am having is the ComboBox on the main form "Form1" is not updated unless I close the application and reopen it again. I was told on another site that I would need to "Fill the Dataset again". But have no clue what they meant or how that is done.
I tried a few suggestions that I had found on a Google Search but alas, nothing works, such as Form1.Refresh, ComboBox1.Refresh etc.
Here is my code for deleting, which is in the DeleteEntry.vb form:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim myconnect As New SqlClient.SqlConnection
myconnect.ConnectionString = "Data Source=.\INFLOWSQL;Initial Catalog=RioDiary;Integrated Security=True"
Dim mycommand As SqlClient.SqlCommand = New SqlClient.SqlCommand()
mycommand.Connection = myconnect
myconnect.Open()
Try
mycommand.CommandText = "DELETE FROM MyDiary WHERE Title = @Title"
mycommand.Parameters.Add("@Title", SqlDbType.VarChar)
For Each row As DataGridViewRow In DataGridView1.SelectedRows
mycommand.Parameters(0).Value = row.Cells(0).Value
mycommand.ExecuteNonQuery()
DataGridView1.Rows.Remove(row)
Next row
MsgBox("Data Successfully Deleted")
Catch ex As System.Data.SqlClient.SqlException
MsgBox(ex.Message)
End Try
ds = New DataSet()
da.SelectCommand = mycommand
da.Fill(ds)
mycommand.Dispose()
Me.Close()
myconnect.Close()
End Sub
And here is Form1:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.MyDiaryTableAdapter.Fill(Me.RioDiaryDataSet5.MyDiary)
Dim con As New SqlConnection(" Data Source=.\INFLOWSQL;Initial Catalog=RioDiary;Integrated Security=True")
cmd.CommandText = "Select Title,DiaryContent,DiaryDate FROM MyDiary "
ComboBox1.Refresh()
Dim da As New SqlDataAdapter
da.SelectCommand = cmd
cmd.Connection = con
da.Fill(ds, "MyDiary")
con.Open()
ComboBox1.DataSource = ds.Tables(0)
ComboBox1.DisplayMember = "Title"
ComboBox1.ValueMember = "DiaryContent"
End Sub
Private Sub NewEntryToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NewEntryToolStripMenuItem.Click
AddEntry.Show()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If (Not Me.ComboBox1.SelectedItem Is Nothing) Then
Dim SelectedItem = TryCast(ComboBox1.SelectedItem, DataRowView)
Me.TextBox1.Text = SelectedItem.Row("DiaryDate").ToString()
Me.TextBox2.Text = SelectedItem.Row("Title").ToString()
Me.TextBox3.Text = SelectedItem.Row("DiaryContent").ToString()
ComboBox1.Refresh()
End If
con.Close()
End Sub
Would anyone please help in shedding some light on this? I have been battling my brains and searching google with three days.
Thank you in advance.
|
|
|
|
|
Dan O'Riordan wrote: and searching google with three days. You'll need to conquer the word "dataset[^]".
A dataset is a collection of in-memory DataTable[^]'s. The query that is executed returns data, and that's stored in that memory-table. You're telling the combobox where to find these values on the line below;
ComboBox1.DataSource = ds.Tables(0)
..and that needs to be filled anew when you want new values.
Dan O'Riordan wrote: The issue I am having is the ComboBox on the main form "Form1" is not updated unless I close the application and reopen it again. Things in a combobox are usually snapshots of that moment; I wouldn't expect it's contents to change while I'm navigating. Would you?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi.
Thanks for that.
I placed
ComboBox1.DataSource = ds.Tables(0)
Into Form1.vb but it made no difference. Is there something else I should be doing?
Thanks.
|
|
|
|
|
Dan O'Riordan wrote: Is there something else I should be doing? Yes; stop trial-and-error, and try to understand the code your going to modify.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Jee man. Thanks for your "help" Bless us all if we have to understand it before we can learn it.
|
|
|
|
|
I can help with explaining code, but I refuse to simply point out what you should change. Sorry, I can't help here.
Also looks like I should take a break from the forum, as these kinds of posts don't add anything valuable
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
"these kinds of posts don't add anything valuable "
True. But thanks anyway.
|
|
|
|
|
I have a UserControl (call it SpiffyCombo) that consists of a ComboBox and a Label. The SpiffyCombo has a property (call it "Code") that has TwoWay databinding specified for it.
My Form has a BindingSource and an associated ErrorProvider. A property of the BindingSource's DataSource is bound to the Code property SpiffyCombo.
In a normal control, when an error occurs on the DataSource's property the error icon would appear next to the control. I can't get this to happen with SpiffyCombo. Is there some sort of Interface I need in the it or something I need to override to receive the error from the ErrorProvider? I want to control how the error is displayed within SpiffyCombo.
Any suggestions are greatly appreciated.
|
|
|
|
|
Don't crosspost.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I am using VB.Net for my program where I have designed a form.
On the left side, I have a list of 100,000+ Items which load in the CheckListBox control on the form load. On the right hand side, I have a ListView control which has multiple columns and shows values related to the Items selected in CheckListBox.
I have created a string variable called ITEMS like this:
Dim ITEMS as String = "'" & CheckListBox.Item(0) & "'"
For int i = 1 To CheckListBox.Count - 1
ITEMS = ITEMS & "'" & CheckListBox(i) & "'"
Next
This stores all the item names in my ITEMS string variable
Now, my Problem here is that when I use following query:
Select * from TableA where Item in(ITEMS)
This query runs for each of the selected items and takes a very long time (perhaps a couple of minutes) to display result in ListView control. I know, the reason here is that I have 100,000+ Items in my list which I am using in IN operator of SQL Query but I am not sure what alternate way I can use to reduce the output time for these many Items.
If there is any other work around to get quicker results, can anyone please help me?
arunpeswani@gmail.com
|
|
|
|
|
Arun Peswani wrote: If there is any other work around to get quicker results, Fewer items in your CheckListBox, that amount is impossible to navigate. Check out the TreeView - you can add checkboxes there too, and it'd be easy to categorize.
There are two points you can optimize; creating the string that contains the selection, and executing the query. If you're going to build a large string, consider a StringBuilder .
Optimizing the query will take some experimenting; perhaps it is faster if you create select statements that are glued together with a UNION , or if you insert the keys you'd like to select into a temp-table and join against that.
..nearly forgot the most obvious; don't select every column, select what you actually use! You don't want to pull a large blob over the network if you're not using it
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for reply dear.
1) I am not exactly using SELECT * FROM TABLE, Actually I have 3 tables to fetch the data from, and I am using OUTER JOINT as well to get the data from selected columns. I doubt if UNION will help me increasing the speed where I want to pull records of my 100,000 Items in my store. Can you share an example query with UNION for my issue?
2) I have never used StringBuilder. Will surely look at this and will give a shot if it is of some help in order to increase the speed.
3) I think TreeView will also give me the same slow speed because in this control also I will have to find the CHECKED items first and then run the query based on those Items.
Please advise if there is something else which can help me in this challenging situation of retrieving the details of 100,000+ items in my application.
I am wondering how does't it work for those professional Inventory applications available in market, how do they manage to maintain the speed for such bulk items' queries?
Any help in order to increase speed of this particular query will be a great help.
arun_peswani@yahoo.co.in
modified 20-Feb-14 0:31am.
|
|
|
|
|
Arun Peswani wrote: I am not exactly using SELECT * FROM TABLE Then you'd need to check if that query can be optimized.
Arun Peswani wrote: Can you share an example query with UNION for my issue? No. There are enough examples on the internet.
Arun Peswani wrote: <layer>I think TreeView will also give me the same slow speed because in this control also I will have to find the CHECKED items first and then run the query based on those Items. You don't need to "find" the selected items; the CheckedListBox has a CheckedItem [^] property, and the treeview has a CheckedNodes [^] property. Both controls can tell you which items have been selected - you'll only need to convert that selection into something that your query accepts. That's the query with the joins that we did not see.
Also, the TreeNode does not have to be loaded completely; one could load everything for the current category, and not load any other (non-expanded) categories.
Arun Peswani wrote: Any help in order to increase speed of this particular query will be a great help. You didn't post the query; if you're going to, I'd suggest using the database-forum.
Arun Peswani wrote: I am wondering how does't it work for those professional Inventory applications available in market, how do they manage to maintain the speed for such bulk items' queries? They don't use a WinControl to show thousands of items and they don't fetch all items on a select.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|