|
|
I am iteration thought the row in order to insert/update/select.
How can I make Async call so it will be run faster
For Each myRow As DataRow In gobjImportDS.Tables(TABLENAME).Rows
.... If FindGIASPROVMSTR(myRow) > 0 Then
' if exists update
If GIASUpdateProviderMasterCommand(myRow) = True Then
Update(myRow)
else
Insert(myRow)
End
Next
|
|
|
|
|
Making it "async" doesn't make it run faster; it just makes it execute independently of the UI-thread. The simplest way to start something on a different thread is by queuing it in the ThreadPool[^].
Sub RunStuffAsync()
Threading.ThreadPool.QueueUserWorkItem(Sub() Bla())
End Sub
Sub Bla()
End Sub
Be carefull not to touch any UI-stuff from that new piece of code; it would crash the application, unless you wrap it nicely in an Invoke-pattern (to invoke the running of the next code on the UI-thread).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
not sure what I have done incorrect.but I it won't go to my sub.
Threading.ThreadPool.QueueUserWorkItem(Sub() modGenelco.ProcessAddChangeInGIASAsync())
Module modGenelco.....
Sub ProcessAddChangeInGIASAsync()...end sub
End Module
|
|
|
|
|
Create a new console application, and add below code;
Module Module1
Sub Main()
Console.WriteLine(Threading.Thread.CurrentThread.ManagedThreadId)
Threading.ThreadPool.QueueUserWorkItem(Sub() modGenelco.ProcessAddChangeInGIASAsync())
Console.ReadKey()
End Sub
End Module
Module modGenelco
Sub ProcessAddChangeInGIASAsync()
Console.WriteLine(Threading.Thread.CurrentThread.ManagedThreadId)
End Sub
End Module Do confirm that you have the correct module, and that the solution is rebuilt.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi all,
I'm having a problem on my code that's throwing me the following error:
'Class does not support Automation or does not support expected interface'
What I'm doing is, we have lot of ActiveX exe and we want to migrate them to .net, but as visual studio doesn't support ActiveX exe migration, I'm following this article ActiveX EXE Wrappers[^] I did one test project and after this worked I tried to migrate a working project.
So I was migrating my ActiveX exe to a Windows forms Application and I adde the following com class to my projec:
clsCom.vb
<ComClass(clsCom.ClassId, clsCom.InterfaceId, clsCom.EventsId)> _
Public Class clsCom
#Region "COM GUIDs"
Public Const ClassId As String = "5f6daa91-519d-4db0-a71a-83a2cc5980cc"
Public Const InterfaceId As String = "dfc3f83c-38a8-43e5-98d1-6914983a9df1"
Public Const EventsId As String = "5ed06d44-d6b6-431b-8804-2ef2a0fb1b70"
#End Region
Public Sub New()
End Sub
Public Shared Sub Main()
End Sub
Public Sub Amend(ByRef lPOSID As Integer)
Dim clsentry As New clsEntry
clsentry.Amend(lPOSID)
End Sub
Public Sub View(ByRef lPOSID As Integer)
Dim clsentry As New clsEntry
clsentry.View(lPOSID)
End Sub
Public Sub Add(ByRef lPOSID As Integer)
Dim clsentry As New clsEntry
clsentry.Add(lPOSID)
End Sub
Public Sub Delete(ByRef lPOSID As Integer)
Dim clsentry As New clsEntry
clsentry.Delete(lPOSID)
End Sub
End Class
After this I created my VB6 to call my Com Object:
Option Explicit
Public placeOfSet As gdcPlaceOfSettlement.clsCom
Public Sub Main()
Set placeOfSet = New gdcPlaceOfSettlement.clsCom
placeOfSet.Amend (5654)
End Sub
The error is ocurring at: Set placeOfSet = New gdcPlaceOfSettlement.clsCom
I don't know what's going on, I've checked few websites and none of them matches with my thread.
Does anyone had the same problem or knows how to fix it?
Thanks in advance.
|
|
|
|
|
If you download the code from the article, and use
Dim MyMsgNet
Set MyMsgNet = CreateObject("MsgNet.ComExpose")
MyMsgNet.StartApplication to instantiate your .NET class from VB6, does it work?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hey Eddy,
I'm using this test as a template, but still geting the same error
|
|
|
|
|
Have you registered the assembly using REGASM ?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi how are u guys, im a begining in the world of the programmation and i like to know how to sum two columns in a truedbgrid, i have one column charge with data from a dataset, then i write the data in the second column, finish the result appear in a third columns that contains data from the same dataset
|
|
|
|
|
What's a "true dbgrid"?
Outside of that, it'd be more efficient to do that when building the dataset; have the database-server determine the sums for the third column.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Before I make this request, I would like to express my profound gratitude to the codeproject bodies, whom with thier aids, I can be proud to call myself upcoming programmer. Once again, thank you all for sources codes, advice etc.
I would like to get my hands sweat by writing advance applications. I saw a software that can read out security code of mobile phones connected to the PC via USB cable, and will display security code on a label. I was doubting the application and I tried it with my own phone and it was my private security code it reads out. So, am wondering how I can write such application using vb6.0 or vb.net. I tried google but no match and am not even sure of the right keywords to use. Any advice, source code, guideline is welcome. Thanks!!!
|
|
|
|
|
The issue is not really about programming, but about mobile phones. What you need to research is sites that explain the internal workings of mobile phones and how you can read from them via the USB interface.
|
|
|
|
|
With VS 2008 VB.Net; I need to create a label (Avery 8161, 1" x 4") that is very involved. 1st line is 12pt, 2nd line 16pt, 3rd line is 14pt, 4th line is 11pt followed by 12pt on the same line. There is a rotated text box that is 20pt and to top it off, there is an area that has filled in shapes (rectangle with 1pt black border and two filled triangles inside that border. I've got the table and can place text but cannot change the font except entire table wide. I haven't found any guidance in doing this in the word tables. Of course, this is the format for all 20 labels on the page. (Don't see any way I can include a picture of the label)
Louis James
|
|
|
|
|
How do I set up connection string for Microsoft OLE DB Provider for DB2?
Dim connection As ??????
|
|
|
|
|
|
|
See: http://www.connectionstrings.com/ibm-db2/[^]
Dim connection As New System.Data.OleDb.OleDbConnection("Provider=DB2OLEDB;...")
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi
I need to serialize a php named array in vb.net 2010 (Desktop app). I believe that the only easy way might be with jquery.
How do you implement a jquery function in vb.net 2010?
If there is an easier way to covert the php named array string to a .net supported object i.e. array, dictionary or collection, etc. PLEASE LET ME KNOW.
|
|
|
|
|
QuickBooksDev wrote: How do you implement a jquery function in vb.net 2010?
With extreme difficulty.
Deserialize it from what format? JSON? XML? What?
|
|
|
|
|
from a php named array string which looks like this:
a:2:{s:3:"foo";s:3:"bar";s:3:"bar";s:3:"foo";}
Is there a good way of handling this?
|
|
|
|
|
That appears to be JSON, but looks malformed.
You can try the stuff found in these[^].
|
|
|
|
|
I am not sure if it is JSON. It is coming from a blob field in a database.
What I sent was only an example of a php named array which is what I think it is.
Here is the actual text that was sent to me (some text has been changed). It comes from the HikaShop shipping_parms field in the shipping table.
o:8:"stdClass":36:{s:19:"shipping_percentage";s:1:"0";s:20:"shipping_per_product";s:1:"0";s:26:"shipping_price_per_product";s :"";s:25:"shipping_override_address";s:1:"0";s:30:"shipping_override_address_text";s :"";s:11:"access_code";s:17:" 8CDDA11596V5822B1";s:7:"user_id";s:10:"test012345";s:8:"password";s:8:"Aec3fX13";s:14:"shipper_number";s:6:"1X2167";s:11:"pickup_type";s:2:"01";s:16:"destination_type";s:4:"auto";s:15:"negotiated_rate";s:1:"0";s:13:"group_package";s:1:"1";s:13:"include_price";s:1:"1";s:18:"exclude_dimensions";s:1:"0";s:20:"weight_approximation";s:1:"5";s:17:"dim_approximation";s :"";s:25:"shipping_warehouse_filter";s :"";s:18:"shipping_min_price";s:1:"0";s:18:"shipping_max_price";s:1:"0";s:25:"shipping_virtual_included";s:1:"1";s:22:"shipping_price_use_tax";s:1:"1";s:21:"shipping_min_quantity";s :"";s:21:"shipping_max_quantity";s :"";s:19:"shipping_min_weight";s:1:"0";s:20:"shipping_weight_unit";s:1:"g";s:19:"shipping_max_weight";s:1:"0";s:19:"shipping_min_volume";s:1:"0";s:18:"shipping_size_unit";s:2:"in";s:19:"shipping_max_volume";s:1:"0";s:19:"shipping_zip_prefix";s :"";s:16:"shipping_min_zip";s :"";s:16:"shipping_max_zip";s :"";s:19:"shipping_zip_suffix";s :"";s:11:"methodsList";s:132:"a:4:{s:16:"ups_next_day_air";s:2:"01";s:18:"ups_second_day_air";s:2:"02";s:10:"ups_ground";s:2:"03";s:14:"ups_express_ca";s:2:"01";}";s:14:"warehousesList";s:275:"a:1:{i ;O:8:"stdClass":8:{s:4:"name";s:7:"Vermont";s:3:"zip";s:5:"41234";s:4:"city";s:6:"Putney";s:7:"country";s:3:"223";s:4:"zone";s:36:"country_United_States_of_America_223";s:9:"zone_name";s:28:"223 United States of America";s:5:"units";s:2:"lb";s:8:"currency";s:1:"2";}}";}
|
|
|
|
|
OK, after looking at that bigger example, that's not JSON.
I don't know of a library that handles serialization of PHP objects.
But, there is this[^]. You can create a PHP project in your solution that handles serialization and deserialization, creating the objects for you.
You can NOT just use an external PHP app because the objects that it creates will not be visible to your .NET code.
|
|
|
|
|
The web doc for Phalanger seems a bit complex.
What I need is
SomeVar = ToClass.ToFunction(BlobString)
Plalanger goes into web pages, complex class functions and cannot see how. Perhaps the simple calculates factorial example technique with
php
Function ToFunction($str)
{
$ar = unserialize($str);
return serialize($array);
}
VB
Dim Ojb as object = ToClass.ToFunction(MyBlobString)
would work???
|
|
|
|