Visual Basic .NET (VB.NET) is an object-oriented computer programming language that can be viewed as an evolution of Microsoft's Visual Basic 6 (VB6) but implemented on the Microsoft .NET Framework.

learn more… | top users | synonyms

5
votes
2answers
48 views

Calling functions with different variable types

I need to call the function that will get the value of a datatable cell with the ColIndex, either a text (column name) or an integer (...
5
votes
1answer
52 views

Generating controls based on PropertyInfo

This is a class that takes a PropertyInfo and makes a Control for it. You can access the value of the control through a property on the class called Value. ...
5
votes
2answers
42 views

Modified TextBox for forms generating SQL statements

An overview of what I've done: I've inherited System.Windows.Forms.TextBox and added a few properties to help me out in creating forms that generate SQL ...
7
votes
3answers
267 views

Data Access Layer

This code review request is regarding data access layer coding. I have used the method I am about to describe in a few smaller applications, but I am noticing limitations that I would like to avoid in ...
2
votes
1answer
50 views

LINQ queries to fetch first and last name

I have these two queries and they work just fine. I use the values they retrieve to populate a title for a view in my application. It seems though that I should be able to accomplish this with one ...
4
votes
3answers
107 views

Solidworks EPDM add-in

I need to expand the functionality of this project to encompass more commands (you may notice in GetSelectedFilePaths() I have a case that is not currently used, ...
1
vote
1answer
35 views

Authentication management

I have the following code and I think it's almost impossible to read and to maintain. I prefer self-explaining and modular code where variable and function names tell what I'm trying to do, but I ...
3
votes
1answer
54 views

Unit testing a service to return items from a database

I have been a developer for many years and get core development concepts, as well as unit testing ones such as DI/Ioc, Mocking etc. I also understand the values, importance of unit testing and writing ...
1
vote
1answer
26 views

Getting a table from an Excel worksheet

I need to get a table from an Excel worksheet. Sometimes I know the worksheet that contains the table, other times I might know it's going to be in one of a handful of worksheets, and still other ...
2
votes
2answers
56 views

Custom SQL statement

I am just wondering if my code can still be simplified. I intend to make it reusable in all update statements. ...
4
votes
2answers
81 views

Storing data into an SQL table using multiple threads and queues

I have a process running in a separate thread which reads data over Ethernet and raises an event for each read. Then, this data is processed over a tree of classes. At the top of my class tree, I want ...
4
votes
0answers
35 views

Global Modal User Alerts in ASP.NET from masterpage

I'm working to implement global alerts by which they reside on the master page, and can be called from both content pages as well as user controls. I'm having an issue with the latter. The goal is to ...
2
votes
1answer
51 views

Web link parser that hunts for a specific string

This handles a parsing system to look at every users profile page and determine their job classification based on the class of a div element. I noticed that the class was always consistent on specific ...
3
votes
2answers
158 views

Checking if an array is initialized and allocated in VB.NET

I am creating an add-in for a piece of software our company uses, so I'm working pretty extensively with that program's API. There are many COM object members which return or contain an array that I ...
6
votes
2answers
95 views

Get list from database in 3 layer model

I'm working on some testing project. For some reason I think I'm doing something wrong with the architecture. I have a simple example to show what I mean. Database class ...
8
votes
3answers
133 views

Automatic variable generation from data table

I am adjusting Fast Report to create some reports, and I have created a loop that runs through query results stored inside a datatable and assigns each TenantName ...
3
votes
1answer
60 views

Checking whether a table has modified rows

The company I am with has a lot of old code migrated over from ALPHA Basic, written back in the 1980s. As development languages have evolved (should I say, "died off"?) the code has been migrated to ...
2
votes
2answers
55 views

Java hashCode method in VB.NET

The point of this method is to emulate Java hashCode(). In order for this to work the project must have arithmetic overflow allowed under: project --> compiler ...
2
votes
1answer
76 views

Vulnerability of Encryption class using AES + HMAC

I've written an encryption-decryption class that is to be used in my companies commercial web application that will handle sensitive information. The encrypted data will be passed over the internet ...
3
votes
0answers
170 views

Swapping Tab Order

The code I have below swaps two tabs around. This is done through creating an array, deleting all tabs and then recreating them which seems very inefficient to me. ...
10
votes
1answer
244 views

Rendering an HTML form based on a specification in a string

Here's a brief explanation of my method: Provide a string and parse it to HTML code respecting a specific format. The accepted format is: For dropdown menu : Test DropDown~Select:Options1; ...
5
votes
3answers
81 views

Userform that calculates gas mileage

I created a project for a programming class that asks you to make a userform in Visual Studio that calculates mileage, given the user inputs of gallons of gas consumed and distance traveled. The code ...
4
votes
2answers
60 views

Creating a wrapper for SqlClient

I'm trying to find out what is the best way to create a class so I can use it to connect to the SQL Server and be able to rollback everything if a single error exists. Right now, I'm using a single ...
4
votes
2answers
109 views

De-serializing and serializing objects to be sent over the network

I am serializing and de-serializing a class object within the class which is then sent over the network like this: ...
2
votes
2answers
89 views

Performance of MySQL helper class for VB.NET

I have inherited this code from my company. It is acting as a helper class for a database and written in VB.NET until date. It is working properly and almost 5 to 10 commercial packages I am ...
1
vote
1answer
67 views

Generate URLs for images hosted on Google Drive

The brief is to be able to generate links to artwork files and PDFs easily and quickly without having to use a browser. I have added an image box which shows the user the image upon clicking one. The ...
4
votes
0answers
48 views

Model-View-Presenter

I work on a .NET application that very loosely followed an n-tier kind of architecture (the business objects (not logic) and data access were split out). We are now looking to start to refactor the ...
3
votes
2answers
41 views

Registering endpoints and HTTP method for exemption of authentication

I have a set of API endpoints where the URL is not standardized, so I could either get "api/auth" or "api/auth/" (may or may not end with "/"). I'm 'registering' the endpoint, plus the HTTP Method ...
3
votes
1answer
81 views

Guess the Number

Continuing with my VB.NET experience, I wrote a quick guess-the-number game. Any improvement suggestions? ...
4
votes
2answers
48 views

FizzBuzz Kickoff

My first FizzBuzz question (well, I asked, then deleted, one previously), and my very first VB.NET question. ...
10
votes
3answers
575 views

Data Access Layer code for MSSQL Databases

We use this class quite a bit for boilerplate / glue that allows web services and applications to call databases. This code is very important, and I'd like to ensure I'm getting the best performance ...
1
vote
1answer
53 views

Creating and sending a Fixed-Width file

This function will run every x seconds. PAN: The name we are calling our fixed width file we are transmitting. ...
7
votes
4answers
109 views

Recursive filename search

I have created a little program to search a set of folders holding documents scanned. The folder structure is as follows: c:\images\year\month\date\documenttype\firstpartofdocumentNo.\ the ...
3
votes
2answers
150 views

Populating fields from stored procedure

I was just wondering if my code below is a good way of populating data from database. I have had no issues with this really but I am being taught this and just wondering if it is the best practice. ...
6
votes
2answers
528 views

Making error messages more efficient

I am using a way of making error messages, and it works fine. It is just starting to get a little annoying as my project gets larger. I was wondering if there was a way to do with with out having to ...
4
votes
2answers
248 views

Performing actions based on command line arguments

I'm currently reviewing a bit of an older console application which performs certain tasks depending on the command line argument that is given. These tasks are called through Windows Task Scheduler. ...
-1
votes
2answers
72 views

Using session values in the body of an email

I created the body of an email by using the following bit of code: ...
2
votes
2answers
703 views

Get alpha numeric count from a string

Following is the code I am using to find a separate count for alphabets and numeric characters in a given alphanumeric string: ...
2
votes
2answers
184 views

Checking consecutive characters in a string

First of all, this code will ask for a number (first) on how many test the user would like to have. Then the user will input the strings depending on how the number entered. ...
3
votes
1answer
117 views

Passing arguments to a SendMail function referenced by addressOf operator

I am trying to send daily mail alert to users based on some timer values. For that I've used Addhandler to call the sendmail() ...
-1
votes
2answers
63 views

Classifying duration as <1, 1-2, 2-3, or >3 years

How can I refactor this method to look cleaner and free from 2 If statements? ...
5
votes
1answer
198 views

Genetically engineered doodle creatures selector combo

I have created an awesome cheat/fan page for the game Doodle Creatures with the help of some cool people in The 2nd Monitor. Is there anything I can do to improve this code? Here is my ASP.NET ...
4
votes
1answer
65 views

Executing a list of tasks from a database

I have a list of tasks I get from my database (as strings) and then execute. However I'm uncertain on how to implement this correctly. Currently I have implemented this in the following way: ...
3
votes
1answer
213 views

Wait for System.IO.StreamReader.ReadLineAsync

I want to wait for a line to be read, but only for so long before timing out. This is what I came up with. Is there a better way to do it? ...
3
votes
3answers
106 views

Zero pad function trim extra leading zeros

Here is a zero pad function I have: ...
1
vote
5answers
249 views

IIF shortern to one datarow .Net

Is it possible to shorten the Isnull checking? It would be great to shorten this code and only have to put the datarow once. This code imports data details (usually there would be more .x = ...
2
votes
2answers
75 views

Avoid Split to reduce memory press (on servers)

I have a Component that is used for all Active Directory queries. The function below is used heavily perhaps even milions of times each day. Performance is a feature! It's used on servers and I ...
10
votes
1answer
67 views

Autocompleting locations

Can this function be cleaner? It looks to me that I have too much nesting (Using + If + ...
5
votes
2answers
215 views

Best way to get the list of XML files

I'm a newbie in the use of LinqToXml and I wonder if I can improve this snippet. ...
1
vote
1answer
34 views

Compare strings by custom sort order

Each letter represent a category. Example the group with "M" Code is greater Than "I" and "C" group. "F" is the higher group Here is what I did but I wonder if there is a better way to do it. ...