IComparable With IComparable(of T) Recommended?
Jan 27, 2010
IComparable(Of T) does not inherit from IComparable. after checking the documentation it doesn't say that its recommended or not recommended to implement IComparable as well if we have IComparable(Of T). so is it ok to implement IComparable(Of T) without implementing IComparable (and making it sync with IComparable(Of T)?
View 2 Replies
ADVERTISEMENT
Aug 17, 2010
I have a DTO that I am using to process transactions. To ensure that it is processing in the correct order, I am using iComparable and sorting the List(of T) of the DTO. That works great. However I just got another requirement that the customer wants the output in a different order... is there a way to allow me to have two different sorts for the same object, or do I need to copy the current class, save the output as a new List of that type and sort using the new way for that object?
View 2 Replies
Jan 15, 2009
This question spawned from an example jmc gave to someone on how to use a structure to implement IComparable... now I always thought that structures could only be used to store basic things like this:
vb.net
Private Structure PersonStruct
Dim FirstName As String
Dim Surname As String
Dim HouseNumber As Integer
End Structure
but it turns out you can define functions, subs, delegates and even events, all from within a structure. So that made me think... whats the real differences between a Structure and a Class? JMC highlighted one difference and that was not being able to create a new instance of a structure and pass in arguments to be initialized but apart from the lack of constructors is there really much difference? I assume there must be as Classes seem to get used a hell of a lot more than structures but I dont really understand why there is a need for both of them if they are so similar... I mean if classes have a few more features then why ever use a structure? Are they more 'lightweight' or something?
View 3 Replies
Feb 19, 2010
I am working on a general helper class to sort ListView SubItems. I wrote a base class that has much of the code I need. It includes a MustOverride for the Compare method so that the various inherited classes can implment their own comparisons based upon their type. For the value types, I end up with very similar code such as the following, where x and y are ListViewItems: Public Overloads Overrides Function Compare(ByVal x As Object, ByVal y As Object, ByVal sortColumnIndex As Integer, ByVal sortOrder As System.Windows.Forms.SortOrder) As Integer [code]
View 3 Replies
Apr 4, 2012
[code]Unable to cast the type 'System.String' to type 'System.IComparable'. LINQ to Entities only supports casting Entity Data Model primitive types. I'm in a DDD-layered application, so the parameter should stay the same as the called method is an overridden interface (eg. if i change this, i have to do this for 200 times or so, because it's in VB.Net and not in C# (= 1 change) )
View 1 Replies
Jun 3, 2009
In the first comment (by J.W.) to this question: Using ObjectDataSource and DataObjectTypeName, How Do You Handle Delete Methods With Just An Id Parameter?, it is said that using ObjectDataSource is a bad design. What is considered good design for well-architected ASP.NET applications?
View 1 Replies
Dec 10, 2009
I'm trying to get started with a simple audio application under .NET 3.5 (preferably in VB.NET, but will happily use C#). What I'd like to do is: Continuously record audio from (the default) Windows audio input device in 8-bits-per-sample PCM format For every N bytes captured, do some analysis on the raw audio (some RMS and/or SPL calculations -- basically what you'd need for a pretty VU bar graph thingy) If the audio fragment is found interesting after analysis, save it using a compressed file format (e.g. MP3)
[Code]...
View 4 Replies
Jan 30, 2010
Which is the recommended approach for copying elements from one control to another? Currently I am using something like this:
For Each a As Control In control.Controls
Controls.Add(a)
Next
Should I stick to it, or should I change to use the ControlCollection.CopyTo method instead?
View 3 Replies
Mar 27, 2012
Just wondering what the recommended practice is for importing namespaces. Are you always better importing the namespace like the fisrt snippet of code, or are you better to type the full namespace inline with your code.
I like both methods; the first is tidier and takes less code, the second can identify exactly where your accessing some logic from which can provide some clarity when looking over the code. Just wondering if there are pros/cons for either or if this is just a personal preference, currently I use a combination but would like to keep consistant.
[Code]...
View 2 Replies
Sep 28, 2009
I come from a C# background but am now working mostly with VB.Net. It seems to me that the above functions (and others - eg. UCase, LCase) etc. are carryovers from VB6 and before. Is the use of these functions frowned upon in VB.Net, or does it purely come down to personal preference?
View 4 Replies
Aug 7, 2010
Meanwhile waiting to further study I would like to imporve my programming skill in Visual Basic 2008, I would like to know if anybody knows where is the good link which is from Microsoft to learn and upgrade VB 2008. Mostly I am more interested in Application program specific in Engineering. anybody can show me the link, I am registered user of Microsoft Visual Studio 2008 and I am Microsoft Certified Professional.Website:
View 4 Replies
May 1, 2009
I was wondering if there is a recommended text for the creation of custom controls? I know a few years ago this book was out: Developing Microsoft .NET Controls with Microsoft Visual Basic .NET (Pro Developer)
It was published in 2003 I think. I have a great deal of experience in VB but not in actual control development, so I don't need a primer on classes and properties and the like. Wondering if this would still be worth it? I never dove into this part of VB and .NET before.
View 2 Replies
May 29, 2010
My program requires the reading and writing to a file that is shared among all users of a system. Currently I keep this file (an XML configuration file) in the directory that my application is installed to, which is C:Program FilesSomething by default. On Windows 7 (and probably XP too, but I haven't checked), regular users cannot write to this file. While I could probably set permissions as needed in my installation program, I'd rather find a more appropriate place for this file.All users need to read and write to it. Doing some Googling turns up C:ProgramData for Windows 7, but XP doesn't create this folder. Is there a common place on both platforms? Finally, is there an environment variable I can query for it?
View 2 Replies
May 2, 2011
The basic setup is this: VB.NET application, using Windows.Forms, a parent form is shown and the user interacts with that. Now, I want to show a child form, modally, configure that form with data from the parent and have the user interact with that child form and then return information to the parent code.Here is one approach that I have used, but it is a bit awkward. Parent has this code:
Dim cf as Child_Form
Dim initdata(3) As Byte
' Set up initdata[code].....
View 2 Replies
Aug 11, 2010
recommended alternatives for speech recognition other than Microsoft Speech libraries?
View 2 Replies
Apr 11, 2012
I am new to working with SQL databases (and databases in general) so I do not have a lot of experience with how queries work and how I can practice them. When I was first learning xml and XPath, I found XPath Visualizer incredibly helpful after someone on stack overflow mentioned it to me.Due to this, I am wondering if a similar tool exists for SQL databases?Basically a tool that will allow me to connect to a database,enter queries and see somehow what the results would be like.
I have looked online a bit, however I have found relatively few options in terms of any utility that would do what I want, and that looks reliable.I will ultimately be writing an application to interact with an SQL 2008 server in vb.net, however for now I am just experimenting so I will know what I am doing when I actually want to create my application.So far I have managed to connect to the database using an OLE DB connection, but I am now looking for a way to experiement with queries without just querying and figuring out a way to interpret the results in my program. Basically I want to be able to remove the programming aspect of things so I can experiment with queries without needing to question anything in my code that is unrelated to the specific query.
View 7 Replies
Aug 7, 2011
PASTE ALL of this to your Form1 code window please and add one Button to Form1.
Now I am asking developers here who actually do software development for a living
especially those persons holding MCPD or similar Microsoft Certification please.
1) When redeclaring a method as in AnotherClass below which Inherits from ExampleClass,
is the recommnded way to use SHADOWS or OVERLOADS please? 2) What about when you do the same with a PROPERTY please?
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
View 4 Replies