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

4
votes
2answers
45 views

Set default value for NULL in datatable

I have the following codes, which I created as extension for datatable in my project. It actually worked. Just wonder if there is any optimization can be made through. Thanks. =) ...
1
vote
1answer
42 views

Long list of SQL parameters and audits

Say I have the following code. What are your thoughts on questions 1-4 below? I think it's way too long when I have to list out most of the fields. Is there any better way of doing this? I build up ...
8
votes
2answers
68 views

VBuzz all fizzed up

I don't normally write vb.net code, and I would rather maintain a monstruous vb6 project than a simple vb.net one. There's something about fizzbuzz going on this weekend, that pushed me to write ...
8
votes
5answers
748 views

Splitting company name into 3 strings

I wrote an algorithm which should cut a companies name into 3 strings. Input: 1 String Output: 3 String. Conditions: String 1 2 and 3 shall not be longer then 35 signs. If the Input ...
8
votes
4answers
465 views

Find if value exists using SQL True/False Return

Aim: To Assess if one, or more, examples of a value exists in a Database in the quickest time as I only needs a True/False result. The variable is Alphanumeric. Question: Is this the quickest and ...
3
votes
1answer
37 views

Optimisation XML handling within vb.net application

I need to optimize this snippet to be faster: ...
10
votes
3answers
337 views

Optimize a Date and Timespan function

I have a working function that may be optimizable. Currently processing 4 objects gives me 0.0459822 for the elapsed time in seconds - used for testing purposes. ...
5
votes
3answers
201 views

Program falls over with larger input files

I have been translating a solution from C# into VB.Net, because I know more VB and wanted to understand it better. I have a version up and running that replicates the C# performance with small input ...
4
votes
2answers
99 views

User Search SQL Builder

Using the VS2012 code analyzer i see the following code has a pretty low Maintainability Index(40) but i cant seem to think of a better way to design it. Does anyone have suggestions on cleaning this ...
2
votes
2answers
69 views

Importing tab delimited file into array

I am needing to import a tab delimited text file that has 11 columns and an unknown number of rows (always minimum 3 rows). I would like to import this text file as an array and be able to call data ...
3
votes
3answers
68 views

Simplify ASP.Net StreamWriter for appendtext to file

Is there anyway to simplify this code so there aren't so many redundant w = File.AppendText(filePath) and w.flush() and ...
3
votes
2answers
588 views

This TDD code seems noisy

This is my very-first-ever run at TDD. How did I do? In keeping with Uncle Bob's Three Rules, I wrote every test first, starting in order from the top down as you see here (below). Here's the ...
4
votes
2answers
365 views

Can this combo box code be more compact and prettier?

I have 3 combo boxes with the same 3 selections in each. If the user picks the same selection a 2nd time, the first combo box resets. I have 3 other sections that will do the same with about 15 combo ...
6
votes
1answer
82 views

Traffic light implementation

Can someone review this code for me? I'm not completely sure I did this correctly. I also would like help creating the code for the "walk" "don't walk" lights. I needed to create a traffic ...
4
votes
2answers
85 views

Excel sheet code is taking too much time

I have an Excel sheet with lot of rows with data. I am separating it into 2 sheets with some condition satisfies. This is taking too much time. How can I improve the speed? Please suggest any ...
6
votes
3answers
272 views

Notify user of upcoming expiration of subscription

Here is some VB code that is part of a major system of apps that I have been asked to maintain, one of the more fun things that I get to do is rewrite some code here and there, I have done a little ...
5
votes
2answers
261 views
2
votes
2answers
141 views

Select evenly spaced subset from array [closed]

Say I have an array with 60 Elements, and I want to select 40 elements from this array. The subset should consist of elements with evenly spaced indices. In theory I would need to select every 1.5th ...
5
votes
1answer
35 views

Separating Duplicates from Uniques

I have a MySQL table with a very large data. What I need is to find and separate duplicates from the unique rows Let's say this is my table: ...
7
votes
2answers
416 views

VB.Net Database Access Class

I've recently been asked to make some emergency changes to a legacy application written in VB.Net. I come from a C# background so am not overly familiar with this language, though there are enough ...
6
votes
2answers
154 views

Inversion of an array that contains indices

I have an array of length n that contains numbers from 0 to n-1 in random order. I now want to "inverse" this array to one that where index i corresponds to the location of i in the source array. ...
3
votes
1answer
41 views

System for tracking stock information

Background: I'm designing a system (VB/WinForms) that uses a database(MS SQL Server 2008 R2) to track people, their stock account #'s, which stocks they are investing in, and the payout of those ...
1
vote
1answer
107 views

Selecting from a database into a DataGridView

I have a piece of code which grabs data from an SQL database and displays it in a DataGridView. This code works perfectly fine for me. It has been pointed out to me that the below code is bad ...
6
votes
1answer
67 views

Customized Template Login

While the MVC4 template provided by Microsoft is useful, I feel there are a few scenarios that should be covered to help out users trying to log in. Allow the user to log in with their email address ...
3
votes
4answers
118 views

Handle multiple menu click events in one Sub

I have multiple menus that will change languages in one Sub that will handle multiple events of the menus click, It is working for me right now, I'm just wondering if there is better way to do it... ...
3
votes
2answers
41 views

How to reformat this code so I don't use 'Exit Try' and 'Exit For'?

I use SonarQube to help me try and become a better programmer to program along with 'best-practice' standards. There are business rules when a user is submitting data they enter in a datagridview ...
7
votes
3answers
103 views

Collect and calculate average times from log, then display top 10 longest durations

Here's a novel-length summary of the issue: I'm trying to write a VB.net program to help me collect remote site statistics from system-generated logs, but I'm a little like a carpenter who only knows ...
1
vote
0answers
133 views

Magic 8 ball game [closed]

I'm trying to implement a magic 8 ball game which produces random answers without any GUI. Since I'm a newbie to VB.NET, I might have not written the program up to the coding standards. ...
1
vote
1answer
90 views

How can this Encryption Class be more secure?

How secure is this encryption? Secondly, is there something I could do to "turn it up a notch" and make it 'more' secure? ...
4
votes
2answers
309 views

Efficent way to Query a DB and write to text file - Large Recordset

I have a SQL query that returns a recordset with between 2 and 5 million records and I need to write that to a .csv file. I wrote the following procedure and I'm curious to see if there is a better / ...
1
vote
1answer
410 views

Simple async/await progress bar

In researching the new .NET Async and Await keywords in .NET 4.5, I created a simple example showing how to update a progress bar and a label while an async function is running. I also included how to ...
5
votes
1answer
121 views

Inserting text file rows into an Access DB - Optimizing

How can I improve my inserts? I am trying to speed up the process of inserting all of the rows in my text file into an Access DB. I originally switched to this route because of the size of those text ...
7
votes
3answers
194 views

Calculate a payment due after X age

I have inherited a function which calculates a first payment due after a certain age. Using the function I typically pass in database values to custom calculate certain dates: ...
6
votes
3answers
207 views

Creating new string with only distinct letters

Aim: To have only one of each character on the Return string: ...
3
votes
2answers
226 views

Using SQL with encryption

This is my first project I am doing in VB.NET, and also my first real programming project. There is sensitive data, so I am utilizing Microsoft's Encryption/Decryption class (...
7
votes
1answer
113 views

MySQL in Vb to update every field of every page of a form in the database

I have a VB code here that connects to a MySQL database to update every control on every page of a form in our database. I am told is taking longer than it should to run. Comment 'Setup MySql ...
4
votes
1answer
521 views

Encrypt Using AES

I'm using Microsoft's example for encrypting/decripting a string. In their example, they are using Tripple DES. I'm trying to convert their code to use AES. The modified code, listed below, works. ...
2
votes
1answer
51 views

SQL Look up in a Stored Procedure across three tables

The idea of the below code is that I feed back to a Gridview if the user has permission to view the property otherwise that property is not show. The data is passed in via SessionParameters ...
2
votes
3answers
138 views

Spelling bee test writer

Is there any way I can cut down on code? I'm new to this. ...
3
votes
5answers
2k views

Is there a better, more efficient way than Dictionary(Of Tuple(), MyClass)?

Suppose I have data coming from different sources that tells me information about a large group of stores that has the following (just an example): Necessary to define what store we're dealing with: ...
2
votes
2answers
189 views

Identifying specific players with the kinect?

I have some code below that takes different detected users recognized by the Kinect and assigns them a specific random id range based on the player they are. I use this to grab the x,y coordinates of ...
1
vote
1answer
132 views

Separating presentation/BLL/DAL

I'm new to ASP.Net and up until now my code has worked but has been a mish mash all over the place with no real structure. I'm trying to teach myself how to keep the presentation/BLL/DAL separate so I ...
6
votes
1answer
132 views

How can I improve this Tic-Tac-Toe code?

This program is supposed to be a player VS player Tic-Tac-Toe game. The computer then checks whether you've won, lost, or tied. The code does work, but I don't want it to work through hacking; I want ...
5
votes
6answers
257 views

Most efficient way to validate multiple textboxes against a tolerance value

I have a series of text boxes in a table to gather input as below: The user will input a target and actual value for each measurement point they require. I would then like to validate the actual ...
3
votes
3answers
141 views

Select case string comparison

I have a select case that checks against a string variable. It's starting to get large and I am wondering if there is a better way of doing this? Here is a sample of the ...
2
votes
1answer
59 views

Improving my invoice generator

In this function, the copy (Write XML) is inside, but I want it to be separated from the function. How can I improve this function? ...
2
votes
2answers
248 views

Add item to an Array 2D using LINQ

I've wrote a generic function to add an item to an Array 2D This is what I have: ...
3
votes
1answer
227 views

Encapsulation with a dbParameter class

I am using the DatabaseHelper class to execute SQL statements e.g. ExecuteDataReader, ExecuteDataTable etc. The signature for ExecuteReader is: ...
5
votes
2answers
196 views

Is there a way to make this code faster? Drawing a point on chart is slow

Is there any way to make this work faster? Here is my sample code in vb.net. This adds a point on a chart at mouse position but it is quite slow. ...