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

2
votes
0answers
30 views

Parsing small sets of data from a large XML using XMLReader [on hold]

Suppose I have a lot of large XMLs I want to parse data from and each of these can range in size from 10MB to well over 300MB. Now, I only need a small sub-set of data from a few specific keys. For ...
10
votes
3answers
199 views

Proper way to validate from sub to sub

I am using a public validating sub to help validate the other subs. Is this the most efficient way to do this? ...
2
votes
1answer
51 views

Calculate percentage of values in an array with a certain condition

I had to write a function that calculates the percentage of values in table less or equal to 2. Is my code right or is there anything missing? ...
1
vote
0answers
23 views

Wrapping a GridView with custom controls

My aim is to create a server control which inherits from a GridView and outputs the basic output wrapped in external markup, including other controls. For example, the output will look something ...
4
votes
1answer
46 views

Using Concurrent Dictionary as First Level Cache

I am currently implementing a thread safe in memory cache mechanism, with the intent of storing objects that are expensive to create or often used by the system. I also want to include expiration ...
5
votes
1answer
148 views

Reading large file, splitting by new line

I am reading a ~120 MB log file (~300 Million lines of text). ...
3
votes
1answer
68 views

Deserialize an email header into key-value pairs

I've created a function that will deserialize an email header into a list of key-value pairs. I've run numerous tests using MS Office Outlook 2010 and MS Office 14.0 Object Library, all of which were ...
2
votes
2answers
75 views

Phone Number Extracting using RegEx And HtmlAgilityPack

I've written this whole code to extract cell numbers from a website. It is extracting numbers perfectly but very slowly, and it's also hanging my Form while Extracting. ...
10
votes
5answers
930 views

Using TryXXX pattern to avoid exceptions

I have been using the TryXXX and GetXXX pattern lately to give clients a choice whether to trap an exception or to read a boolean. An example of this concept would be ...
6
votes
3answers
405 views

Shutdown Delay Program

I wrote this program a while back that would allow me to set a delay, say 3 hours, and when the delay had expired, my PC would turn off. The purpose of it was so I didn't have to leave my PC on all ...
4
votes
2answers
66 views

Evaluating algebra expression using an auxiliary VB class compiled on the fly and consumed in a C# project

I want to create algebra evaluator but I don't want to write my own parser because it takes much time to learn. I don't like algebra expression in C# because it does not look natural compared to VB ...
3
votes
2answers
146 views

Adding string binary numbers

My requirement is to add two binary numbers, say "1001" and "0101" as binary1 and binary2. ...
12
votes
3answers
537 views

Security issues in a SQL query and possible function?

By adding more and more features to my websites, I am now up to 7 different hard coded queries. I have read a lot about SQL injections and possible flaws and security issues, and wanted to make ...
4
votes
1answer
75 views

Filling a table in code behind

I was wondering if there could be an easier or simpler way of filling a table with code behind. So far I have my html/asp.net table : ...
2
votes
2answers
134 views

Extract numbers from an AlphaNumeric string

I have an alphanumeric string like sdff45hg589>@#DF456&<jk778P&&FHJ75, of which I want to extract only the numbers, without using regex or any ...
6
votes
3answers
128 views

Cryptographic Random Number Generator function implementation

While surfing and through some experimentation, I have a new method to generate random numbers without using Randomize or Random ...
6
votes
2answers
169 views

Positive integer to Roman Numeral conversion function

For the past two hours I was searching for a built-in function for converting an integer to an equivalent Roman numeral, but it failed to achieve the target. Hence I wrote my own routine for ...
5
votes
2answers
125 views

Numeric selfmade CAPTCHA in Windows application

Nowadays many sites introduce CAPTCHAs (Completely Automated Public Turing test to tell Computers and Humans Apart) for securing their sites. I wish to introduce the technique in windows forms, as ...
0
votes
1answer
96 views

Is this a better way to validate a text box for mobile number only?

Is this a better way to validate a text box for mobile number only? Validation: allow only numbers will not allow to paste string including characters allow copy from the box length is set to 10 ...
3
votes
2answers
109 views
10
votes
2answers
214 views

Number to Words

I have to convert positive numbers, that are less than 1000, to words. A quick search didn't find anything that looked good to my eye, so I came up with the following. While I was at it I expanded ...
5
votes
2answers
548 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. =) ...
2
votes
1answer
64 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 ...
10
votes
2answers
82 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 ...
9
votes
4answers
791 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 ...
10
votes
4answers
781 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
58 views

Optimisation XML handling within vb.net application

I need to optimize this snippet to be faster: ...
12
votes
3answers
366 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
212 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 ...
5
votes
2answers
146 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
110 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
90 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
597 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
381 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 ...
7
votes
1answer
170 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
143 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
315 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
273 views
2
votes
2answers
188 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
38 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
1k 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
164 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. ...
4
votes
1answer
46 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
2answers
208 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 ...
7
votes
1answer
83 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
5answers
298 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
45 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 ...
8
votes
3answers
114 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
1answer
108 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? ...