Visual Basic .NET is a .NET oriented-object implementation and evolution of Visual Basic developed by Microsoft.

learn more… | top users | synonyms

3
votes
1answer
55 views

Can an object contain a property that is another object?

I am new in the object oriented world. I am interested on learn the foundations of object oriented programming independently of any language. But for the moment I am doing the implementation on ...
-2
votes
0answers
8 views

How to create icon overlay? [migrated]

I tried this howto: http://www.codeproject.com/Articles/545781/NET-Shell-Extensions-Shell-Icon-Overlay-Handlers Option Strict On Option Explicit On Imports System.Runtime.InteropServices Imports ...
-2
votes
0answers
77 views

Database structure for an Android chat application

I have a structuring or rather designing problem. I am developing an Android chat application and I need to know if anyone has an idea on how the database should be structured to allow group and ...
1
vote
1answer
316 views

What is the best approach to storing a multi-dimensional array with unknown bounds?

I'm trying to store content scraped from several lyric and chord websites into separate variables into either a multi-dimensional array, or into separate string arrays, but I've been stuck trying some ...
2
votes
4answers
117 views

Alternative way to expose you're returning Nothing in a method

I'm kind of in an impasse here. Lets say I have module A which exposes some methods returning objets and module B that uses said methods from Module A. Module A will have situations when it will have ...
3
votes
1answer
119 views

“Best Practices” when designing large applications with multiple functions

A little background first. I have been tasked with rewriting our gun software into VB.Net (converting the code from BBJ). This software incorporates many different inventory management functions, such ...
15
votes
6answers
756 views

Methods of debugging code (Nightmare situation)

I am frequently tasked with debugging an application at my job. It is a BI Application that we deploy to businesses, which includes a test environment, and a production environment. I am wondering if ...
0
votes
0answers
43 views

Use vb.net sql reader as a Delegate to gather Data

Is there a way to use a sub to create a loop, but change the content of the inside of the loop? I don't know what I don't know. I keep looking at this code and I have a feeling that it's possible. ...
3
votes
0answers
38 views

Is it OK to have a property of type COM object

I am developing a COM addin for Microsoft Excel, using VB.Net. I wrote a class to represent a worksheet that contains certain elements. Let's say for example it has a ListObject. I create a property ...
1
vote
1answer
105 views

How can regular expression be ambiguous?

I am recoqnizing this pattern <.*> From string <a href="hello world">Hi Baby</a> Now, there are several match <a href="hello world"> is a match <a href="hello ...
3
votes
2answers
281 views

Should we include Nuget PACKAGE folder in version control?

I would like to know In C# or VB.NET project should we include the PACKAGE folder (nugget package folder that is created to the root of my project that contain the nupkg files and other content) to ...
6
votes
7answers
22k views

string.format with variables vs inline variables

What are the pros/cons (if any) to using string output; int i = 10; output = string.Format("the int is {0}", i); versus string output; int i = 10; output = "the int is " + i; I have always ...
5
votes
2answers
150 views

Is it acceptable to define a “module” and “class” within a single .VB element?

Experiment: I have found it is possible to define both a "Module" (Namespace?) and a "Class" (Namespace?) within a single .Vb element (Module??). You can try this at home: Create a new Console ...
1
vote
1answer
189 views

OPTION STRICT set to off [closed]

I am working on an application with over one million lines of code. OPTION STRICT is set to off!. I want to set it to ON during the next work iteration. I believe the only reason OPTION STRICT ...
1
vote
2answers
145 views

Refactoring method with nested loops and 6 variables [duplicate]

I have a method which implements a small section of a (complex) algorithm. This algorithm has taken me several weeks to perfect and is by far the fastest method I can find. The method in question has ...
2
votes
1answer
68 views

Exception to the 'Nested types should not be visible' rule?

Is the following an acceptable breach of the 'Nested types should not be visible' (Microsoft .NET code analysis CA1034) rule? I have a have a class, let's call it 'TandAOLL', this is tree and an ...
5
votes
7answers
3k views

Is there something better than a StringBuilder for big blocks of SQL in the code

I'm just tired of making a big SQL statement, test it, and then paste the SQL into the code and adding all the sqlstmt.append(" at the beginning and the ") at the end. It's 2011, isn't there a better ...
1
vote
0answers
62 views

Metrics for when to use a hash value?

I am working on a project that requires a series of flat files. I will be doing some data checking against simple date like: ID;StatusCode So a typical file might be like: 13993;R 38293;A 19349;I ...
4
votes
2answers
541 views

Is CType() ever the preferred option?

Is there any time CType() is the proper option over other methods? I did plenty of thinking on this myself, but wanted to put the question in hopes there would be answer to my question so I can put ...
2
votes
1answer
77 views

Parsing XML to two separate (WInForm) controls

I've spent a great deal of time researching a solution to my issue with very little success. I'm rather new with .NET and vb.net so I apologize if this seems simple to anyone else. I had a first ...
0
votes
2answers
255 views

How to avoid using service location when using dependency injection? [closed]

I am trying to use dependency injection in a WPF application, and I really can't figure how to avoid using service location, which is considered to be an anti-pattern in many articles. I am using the ...
13
votes
16answers
1k views

Should a c# dev switch to VB.net when the team language base is mixed?

I recently joined a new development team where the language preferences are mixed on the .net platform. Dev 1: Knows VB.net, does not know c# Dev 2: Knows VB.net, does not know c# Dev 3: Knows c# ...
4
votes
2answers
178 views

Handling exceptions in a loop without breaking the loop (try to process all members)

Scenario: I have a loop that iterates over an Array of COM objects and does some work using them. My fear, working with COM objects, is that some exception will creep up (possibly on another ...
-1
votes
2answers
111 views

Should client side have a log? [closed]

The client side of my application is written in VB.Net, it accesses a java server. Server logs every request that was made by client, client shows every exception to the user (with an option to send ...
1
vote
2answers
101 views

When to turn off Option Strict? Or how to deal with inheritance of COM using Option Strict?

I'm trying develop an add-in for an application using it's API and I have Option Strict turned on. Trying to work with these COM objects is causing multiple compile issues saying Option Strict ...
3
votes
3answers
461 views

Is it bad practice to register assemblies in the GAC?

I have moved a few assemblies to the Global Assembly Cache because they are used by multiple applications i.e. a VB.NET app and an ASP.NET app. I remember a few years ago when I started in my current ...
4
votes
3answers
581 views

Saving to Registry vs. CustomFile [closed]

I've been using the usual My.Settings... method when it came to saving settings for my program but I was just wondering, If I wanted to save program settings into the Registry and load those settings, ...
0
votes
3answers
224 views

Understanding VB.NET variable scope

What's the difference between this code snippet: Sub Test() Dim i as Integer = 0 Dim q as String = "" While i<10 q=String.Format("Some text {0}", i) Console.WriteLn(q) i=i+1 ...
1
vote
2answers
683 views

DLL or web service for common functions?

We have a variety of basic functions (date utilities, email sending, internal math calculations, etc) that are currently in an old VB.NET project. We're going to move towards C# and I'm wondering if ...
0
votes
0answers
131 views

How to model dynamic table schema in .Net code

I am preparing to do an upgrade of a fairly large program that is currently written entirely in MS Access, both GUI and data (code and data in separate files). One of the key features of the product ...
-1
votes
1answer
169 views

Generate all possible outcomes from pattern or range

I have multiple patterns that I want to expand. Expansion should expand number and letter ranges between curly braces. Numbers need to support padding. I want to have it expand into a List(Of String) ...
0
votes
1answer
283 views

proper exception handling (throwing/message) dll libary

I just wrote a dll library using vb.net. while testing, i got an error which i did not initially use a try-catch block. The code is Try 'The first four bytes are for the Command ...
3
votes
1answer
177 views

How to design similar purpose static methods

I know that you cannot override static functions, but for what I'm looking to do, it seems like the logical way to design my class. I have a method that is associated with my abstract class, that i ...
1
vote
1answer
527 views

.NET WCF: Persistent connection or Open/Close as needed?

I have a .NET WCF web service currently running in production right now. I would say 95% of the time it works flawlessly and as intended. However; there are times when I am throwing an exception that ...
3
votes
2answers
294 views

An algorithm that spreads similar items across a list

I need an algorithm that distributes same items across a list, so maximizing the distance between occurrences. E.g. I have a list of 15 items: {a,b,c,c,c,d,e,f,f,f,g,h,h,i,j} The algorithm should ...
1
vote
1answer
142 views

How can I share a managed DBConnection across various objects?

I am implementing what I thought was a simple object wrapper around a database where one object "PartRecord" represents one row of a database table. I want a client to be able to request a given ...
3
votes
1answer
464 views

Trying to get a better understanding of Interfaces

Im working on a small program and I thought i would use it as a chance to get a better understanding of things I haven't really used before, mainly Interfaces and Inheritance from base classes. ...
26
votes
6answers
54k views

.NET Properties - Use Private Set or ReadOnly Property?

In what situation should I use a Private Set on a property versus making it a ReadOnly property? Take into consideration the two very simplistic examples below. First example: Public Class Person ...
3
votes
1answer
520 views

Where to keep global variables in Windows Forms App

I have here a Vb.Net employee management application. It has employees, managers, teams, trainings and so on. The way the application is set up now, data is read from the database in the startup form ...
0
votes
1answer
2k views

VB.NET - Serial Key Generating (Encryption, Hashing, Encoding?) Algorithm

I am trying to create a basic licensing system where I take a unique ID from the client computer, and I get this Hexadecimal string (hyphens removed e.g. "84-18-CE-...."): ...
2
votes
1answer
464 views

Compiler warnings and errors [duplicate]

I come from a C# background before my existing role. I am developing a VB.NET app. The code I inherited had option strict set to off and all other directives set to 'None'. I have recently switched ...
0
votes
2answers
511 views

Why And is needed when there is AndAlso

I have referred What is the difference between And and AndAlso in VB.net? to understand the difference between And and AndAlso. I am from C# background - and C# has AndAlso only - no And.. And I ...
2
votes
2answers
180 views

Static / Shared Helper Functions vs Built-In Methods

This is a simple question but a design consideration that I often run across in my day to day development work. Lets say that you have a class that represents some kinds of collection. Public ...
2
votes
1answer
303 views

What language is better for working with databases? [closed]

I am going to develop a software that works with different databases and I'm considering whether to use .NET languages or C++. I've known that .NET features LINQ and ADO.NET but are there features ...
2
votes
1answer
361 views

When to add new project to solution?

I'm tidying up my company's Version Control Guidelines. One of my tasks is to determine how solutions should be organized in a very broad sense. I have somewhat come to my own conclusion that one ...
1
vote
2answers
86 views

Agile retesting

I wrote some code about two years ago, which was deployed to the production environment. The code deletes information that is six years old from a system. When it was first deployed there were only ...
1
vote
1answer
1k views

Is VB.Net deprecated by Microsoft? [closed]

I have come to this web page from Sony: http://www.sonycreativesoftware.com/scripting_in_vegas_pro_and_sound_forge We suggest you use C# for your scripts, since although you can currently write ...
1
vote
2answers
584 views

Sending emails from server side

I need to read some of your opinions. I'm developing a desktop app (.net/winform) to keep data in one place. This is used by several clients and the data is stored in MS SQL Server (client-server ...
0
votes
1answer
563 views

Are VB.NET and C#.NET projects created from Microsoft Visual Studio “Open Source” safe? [closed]

I'm developing software in VB.NET and C#.NET and planning to release their source codes as fully open source. Are these projects "open-source" safe? My doubts are: VB.NET and C#.NET are using the ...
1
vote
3answers
521 views

Where to Populate Objects

As mentioned in this question, I am moving our team towards objects (as opposed to just throwing DataTables and variables around everywhere). I have picked a suitable spot for the project that ...