|
Ok, if I read you correctly your background app is running looking for data from the RS232- serial port barcode scanner. So there is an active port it is looking at. Change the active port to the USB, The app needs to know what to look for on the system. You should have a Setup barcode for USB host type, Try the IBM Hand-held code, Make 100% sure you do not miss scan set-up BC’s as this will mess you up every time. If you still are having a problem I would ask the OEM of the UBS-BC Scanner…I’m sure they have had the problem and fixed it, it is just not in the docs…
|
|
|
|
|
I have this error, Can any one help me to solve it as soon as possible
Cross thread operation not valid: Control textBox1 accessed from a thread other than the thread it was created on.
|
|
|
|
|
I have a helper class to strongly type data:
Public Class SupplierTrans
Private _date As Date
Private _period As Integer
Private _year As Integer
Private _type As String
Private _reference As String
Private _portfolio As String
Private _netamount As Decimal
Private _taxAmount As Decimal
Private _paidAmount As Decimal
Public Sub New(ByVal transdate As Date, ByVal period As Integer, ByVal year As Integer, ByVal type As String, ByVal reference As String, ByVal portfolio As String, ByVal netamount As Decimal, ByVal taxamount As Decimal, ByVal paidamount As Decimal)
_date = transdate
_period = period
_year = year
_type = type
_reference = reference
_portfolio = portfolio
_netamount = netamount
_taxAmount = taxamount
_paidAmount = paidamount
End Sub
Public ReadOnly Property TransDate() As Date
Get
Return _date
End Get
End Property
Public ReadOnly Property Period() As Integer
Get
Return _period
End Get
End Property
Public ReadOnly Property Year() As Integer
Get
Return _year
End Get
End Property
Public ReadOnly Property Type() As String
Get
Return _type
End Get
End Property
Public ReadOnly Property Reference() As String
Get
Return _reference
End Get
End Property
Public ReadOnly Property Portfolio() As String
Get
Return _portfolio
End Get
End Property
Public ReadOnly Property NetAmount() As Decimal
Get
Return _netamount
End Get
End Property
Public ReadOnly Property TaxAmount() As Decimal
Get
Return _taxAmount
End Get
End Property
Public ReadOnly Property PaidAmount() As Decimal
Get
Return _paidAmount
End Get
End Property
End Class
I am using LINQ to query a generic list (transactions):
Dim tranItems = (From trans In transactions Order By trans.TranDate Group trans By trans.SourceID Into grouping = Group Select New SupplierTrans()).ToList()
but am having touble in referencing the transactions columns within the
'Select New SupplierTrans()' section.
I have tried
Select New SupplierTrans(TranDate ...) without success. The columns (TranDate etc) as now shown in the context hinting. How can I correctly reference these items please?
|
|
|
|
|
Because you created a Constructor, it overrides the default constructor so you cannot do new supplierTrans() unless you specify all the required fields. You have to recreate a default constructor, that is if I remember correctly. If I'm wrong I'm sure someone will correct me.
|
|
|
|
|
First, I would suggest that next time (and this time in your code) you put some line breaks in the query.
As to the problem in your query, let's take a look at what you get at each step of the query:
dim items = From trans In transactions _ 'you haven't done anything yet
Order By trans.TranDate _ 'now the entire list is sorted by transaction date
'but you still return IEnumerable(Of SupplierTrans)
Group trans By trans.SourceID _
Into grouping = Group 'this will create an IEnumerable of an anonymous type
'with the SourceID for the group and an IEnumerable of
'all transactions with that SourceID.
It's not very clear what you are trying to make here, but if you just wanted to sort the list by TranDate and SourceID, you may have been better off with two Order By statements. If you do want the groupings, you could have simply written Group By trans.SourceID Into Group to get the same result.
Just remember that the IDE and Intellisense will almost always give you all the information you need to see what you have at any point. If I were to hover over the items variable, I would see that it is an IEnumerable(Of <anonymous type> ) . From there I can type items.First. and Intellisense will pop up the list of members for that anonymous type (in this case grouping and SourceID).
|
|
|
|
|
Hi All,
I am developing a project that sending bulk sms to mobile using serial port. Most of the time it is working properly. Some times am getting the error like,
"The semaphore timeout period has expired"
"The remote system refused the network connection"
and
"The format of the specified network name is invalid"
I have tried with Google search...I got so many articles about this.
But i didn't get the actual resources.
I don't understand the reason behind it. May I get some ideas??
Thanks in Advance
|
|
|
|
|
You're going to have to start reading and testing possible solutions yourself. It does not appear to be anything wrong with your code, but with an underlying network issue.
|
|
|
|
|
<b>Sample dll code: </b>
Public Class SWTest
Public Shared Sub kv()
MsgBox("Code Project")
End Sub
End Class
Please help me, how can i import this dll and call the procedure at runtime
Note: My windows application only have the string inputs of (dll) file path and procedure name
Example:
Input1 = "D:\SWTest.dll"
Input2 = "kv"
Thanks
KV
|
|
|
|
|
|
hi,
i used your link sample, but i was got this error
Value cannot be null.
Parameter name: ptr
FYI: Please download my sample project from this link <a href="http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html">http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html</a>[<a href="http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html" target="_blank" title="New Window">^</a>]
Note: Please send me any sample project attachment to my email id (to_velu@yahoo.co.in) if possible.
|
|
|
|
|
Download link
http://www.2shared.com/file/4835939/1eaac353/RunTime_Dll.html
|
|
|
|
|
The method you are using (and was suggested in my link) works for ActiveX Dlls and OCX objects.
First, have your class library a module not a class:
Public Module TestDll
Public Sub Test()
MsgBox("Hi")
End Sub
End Module
Then use LoadLibrary to load the dll.
Delegate Sub Tst()
.
.
.
Static dll_loaded As Boolean, dll_handle As Int32, fn As tst
dll_handle = LoadLibrary("Testdll.dll")
msgfn = GetProcAddress(dll_handle, "Test")
msgfn.Invoke()
By the way, why do you want to late-bind?
Try using
Declare which makes it much faster and more reliable!
|
|
|
|
|
I believe you need to read up on Late Binding[^]
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi,
What would you think if the listview is not showing the Turkish characters in the rows after placing a splitter container and moving listview into splitter's one side panel and setting the fonts same for both controls. This problem turned in to a disaster for me. Eventough I used UTF encoding to the strings the problem haven't changed.
Here how I tested the problem to make sure the turkish characters were diplayed in the listview properly.
I created a new form and placed a listview with one column and then I listed the file mames which contained some turkish characters in this column. It showed perfectly. However, after adding a splitter container control on to form and moving listview inside of this container and adding a few more columns to listview did start not showing the Turkish characters anymore in the listview but strange characters.
Now I wonder what would you think about such problem and how to solve it?
Thanks for reading.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Recheck the properties of your ListView. It is possible that 1 or more have reset to the defaults, when you moved the ListView control into the splitter
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
The problem remains the same I have checked to see if any property attribute set to default.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi,
How could you determine if a read item is a folder or a file in vb.net? For an instance I have read all the files under directory. At the same time there is a sub directory under the directory and I want to get its type.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
modified on Sunday, February 8, 2009 1:54 PM
|
|
|
|
|
Hi,
File attributes would tell you. Here is a C# example, I don't have it in VB.NET:
FileInfo info=new FileInfo(fileName);
attributes=info.Attributes;
bool isFolder=(attributes & FileAttributes.Directory)!=0;
...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
The equivalent vb code is:
<code>
Dim info as New FileInfo(fileName)
Dim isFolder As Boolean = info.Attributes And FileAttributes.Directory
</code>
|
|
|
|
|
If IO.File.Exists(Path) Then
'It is a file
ElseIf IO.Directory.Exists(Path) Then
'It is a folder
End If
|
|
|
|
|
I'm using vb.net application form
My form requests user to enter ID in text area to retreive some data for printing
I want to know is it possible to pass this ID as a paramter when I call the web application form without requesting user to submit it I mean that I will send user link of the application form with the ID as a parameter just as we do in a web form.
|
|
|
|
|
Naglaa Saeed wrote: I mean that I will send user link of the application form
Your question doesn't make sense. There's no such thing. You cannot instantiate, or call, a windows form from a URL, at least, not in the way you're implying.
Are you asking how to call a windows form from a web form?? Or, forgetting the web analogy, are you asking how to pass a username to a login form and execute the code on the login form, without the user typing the information into the form??
|
|
|
|
|
You can use Parametrized constructor or Property if you want to pass a parameter from one Form to another.
Naglaa Saeed wrote: I will send user link of the application form with the ID
In this case, you can use start your application with commandline argument. In main method check the argument and set the value accordingly.
|
|
|
|
|
If I have understood you correctly, you might use commandline parameters to run your application, or as mentioned by crudeCodeYogi, by using parametrized constructors.
|
|
|
|
|
Hi,
I am Using MS Access 2002 Databe & vb.net 2005 in my Project.
In My Project is Select Command working Properly, But Insert & Update Command is giving Error ("Syntex Error in Update Statement" or in Insert Error in Insert Statement.
I am using this function for update
Private Function UpdateUser(ByVal Password As String, ByVal UserID As Integer)
Try
Dim strcmd As String = "update tblLogin set Password='" + Password + "' where UserID =" & UserID.ToString
Dim cmd As New OleDbCommand(strcmd, con)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error Message")
End Try
Return 0
End Function
What is the solution for this
Plese Help Me.
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|