Questions tagged [vb.net]

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
49 views

Extract value from a database and populate objects

I have a database, with some history data for a lot of tags (ie. measurement points in the plant). Users supply a calculation script, and get the result of the calculation as a result. The main ...
2
votes
1answer
181 views

Building a very basic calculator

I have been a VB developer for couple of years, but strictly using functional programming paradigms — I just started using object-oriented paradigms a few days ago, and want some advice on how ...
1
vote
0answers
28 views

Copy / paste special excel row

This is part of Invoice. If I have 20 items of it I need to copy nth row (because end user set format only on few cells in nth row) so to keep it formated I need to copy entire row and paste it ...
2
votes
0answers
247 views

Passing a form reference for accessing control in other class

I have a form and one other class that basically maintains initialization state of the form (in this case, loading data from Json file to controls in form). My form code: ...
5
votes
2answers
2k views

Create URL query string from dictionary

I have a dictionary of parameters and value, and the function creates a URL query string from it: ...
0
votes
1answer
70 views

Simple property formatting

In a VB.Net class, I have an method that replaces all square brackets [] in certain properties by normal brackets (). Edit: The ...
2
votes
2answers
80 views

How to avoid code duplication in ordering system

Here is the piece of order system. And this is hierarchy of order classes in this system ...
2
votes
1answer
85 views

Marshaling to a complex structure in .net

This is a follow up from question https://stackoverflow.com/questions/45106245/net-file-random-access-recoard-locking I have been able to make the reading and marshalling work ok but the performance ...
2
votes
0answers
48 views

Updating Excel sheet with information from a DataTable

Basically, I'm trying to update an excel sheet using a DataTable (The columns structure between the two are not the same) with respect to the following rules: ...
2
votes
1answer
104 views

Numbers to words

A bit of code I made in VB.NET to convert the digit form of integers into words. I've intentionally assumed that inputs will match the desired format since the focus of this task for me was to ...
4
votes
1answer
159 views

Abelian sandpile

I am trying to programm the Abelian sandpile model in VisualBasic. Also, here is a youtube video made by Numberphile about the very same topic. Here is a picture (\$2^{20}\$ grains of sand) I made ...
0
votes
1answer
17 views

Padded Version.ToString() extension

I want to convert a Version object to a string, but with the parts padded to a given width. E.g. 0.22.1 with parts padded to a ...
1
vote
1answer
56 views

Read date from a file and rename two files using the date

Problem I have image files that are RAW data and have the extension .NEF Whatever edits I make to these files are stored in what is called a sidecar file with the ...
1
vote
1answer
67 views

Recursive function to merge 3D objects

I have several 3D items in listOri. For this example: listOri has A,B,C,D,E. A overlaps with C. B overlaps with D. D overlaps with E. I have a recursive ...
1
vote
1answer
45 views

SQL subquery to determine whether or not a particular row is the first item that matches the subquery

Here is my VB.NET and SQL query (which is one of the things I'm particularly interested in having critiqued): ...
2
votes
0answers
71 views

LightsOut - A homework framework for teaching CS to non-engineers

This provides a fill-in-the-blanks homework framework to implement the game "LightsOut". LightsOut is a game with a grid of lights. When you touch a light, it toggles it’s state; it ALSO toggles the ...
1
vote
1answer
60 views

Optimize Arraylist function call

I am using the following to retrieve some user info based on IP address. ClientLocation() returns an array with city, state and coordinates. My concern with this ...
1
vote
0answers
149 views

Optimizing Levenshtein Distance with nested loop

Brief illustration: I have 2 classes - tbCustomer and tbDHN which is stored inside a list....
6
votes
1answer
2k views

AES encryption/decryption using pure .NET and streams

I'm trying my hand at simple encryption and decryption. Ideally I'd like to be doing it the 'right' way, ie something secure without doing it in a way that will have a serious hole. I'd prefer to do ...
1
vote
2answers
384 views

Find and display the position of a word in a sentence

How can I simplify this code: ...
2
votes
1answer
242 views

LinQ wrapper to get distinct items from a IEnumerable based on a function of item

I often need to perform LinQ queries to get distinct items from a IEnumerable based on one of its properties. I would like to know if this is a good way to wrap this operation: ...
6
votes
2answers
60 views

Using/reusing the SQL Command for several Inserts in the SQL Transaction

I'm using the code below to save a record in my database. I was thinking that I am creating new instances of the SQL Command object and fear that I might be bloating the system memory and not doing ...
2
votes
0answers
803 views

Find and replace text inside text boxes in MS Word

I have this procedure to realise a find and replace on a word document. Since I have text boxes, using this way to do this is a bit a slower than what I'd like it to be, if it were just text on a ...
2
votes
0answers
52 views

Requesting information about people from a web API

I'm requesting from a web API information about 20,000 people that I need to update continuously at lightning speed (the web server doesn't throttle the number of requests). I can request an update on ...
4
votes
2answers
152 views

Setting fields, with default values, before saving a row

I would like to find out if there's a cleaner way to go about validating input before it goes into a function. What I'm doing seems like a lot of code, I'm sure there's a better way. I would also ...
3
votes
1answer
87 views

Finding black and white images

I am looking to speed up the search for black and white images. I have about 150,000 images that I need to check but this is taking so long. How can I speed up the code? ...
2
votes
0answers
39 views

Creating an Excel sheet and appending namings for a matrix

I'm working on some VB.Net code to generate data sheets for giving user rights on a per folder level. I came up with this code but it's very slow and I feel like it could be improved. ...
4
votes
1answer
331 views

Display factorial with user-entered number

This needs some optimizing without any additional variables or loops. The difficult part of the task was no additional variables subroutines/functions or loops. If that seems (near) impossible then ...
1
vote
1answer
64 views

Database Dynamic Table Creation

The code below is meant to build an array with certain properties neccesairy to create column for a table in a database. Would there be any more effcient way of doing this? ...
4
votes
2answers
586 views

Evaluate a game of tic-tac-toe to determine winner

So the program will take input of a series of 9 integers which indicate which square was played on each move. Player 1 is always X and player 2 is always ...
7
votes
3answers
443 views

Update 12 records in a database table in less than 13 queries

I've got a database table in my application called "periods". The structure of the table is: Year (Number) Month (Number) Period (Text) The Year column stores years (Say, 2016), Month stores months (...
0
votes
1answer
145 views

Security check using an SQL call

In our latest Veracode scan for an application, I have come across the issue of Improper Resource Shutdown or Release. It is pointing at a function. Here's what the code looks like: ...
3
votes
2answers
43 views

Parsing and extracting all IDs from a document (using regex with capture)

I'm interested in parsing and extracting the IDs found in a document. The IDs are found throughout the document in the this format: IDStart=1FG3392MQ9&IDEnd The "1FG3392MQ9" is an example of ...
3
votes
2answers
61 views

Raise a list of integers to powers and return uniques

Problem (inspired by Project Euler 29): Consider all integer combinations of ab for X ≤ a ≤ Y and X ≤ b ≤ Y Return a sequence of distinct terms in numerical order Input is a list of 2 ...
6
votes
4answers
273 views

Fizzbuzz of course

My second attempt with vb.net - I tried taking the advice from yesterday's question into consideration, but I did not try using LINQ. You know the drill: A programming challenge that prints the ...
5
votes
1answer
955 views

Download Images as fast as possible

I have a spreed sheet and its something like 550+ columns and I need to pull URLs from it. Previously I was using LinqToExcel when the sheet was less than 255 columns a recent update has produced this ...
3
votes
2answers
106 views

Take input of delimited file of integers and output result

I wanted to learn some new language so I developed a really simple vb.net "console application" (was that the right type?) that takes text input, looks at it and multiplies it if it's even and then ...
2
votes
0answers
123 views

Multithreaded download of images from a spreadsheet

I've been wanting to go async with my HTTP calls but all the methods I tried have not worked, so I resolved to implement this as a task and then improve upon it. This is what I've come up with so far....
1
vote
2answers
94 views

Searching local drive for multiple files

Well, I'm writing a piece of code that will take a list of file names and should search a local drive for each file, determine if it's there or not, and return an array of all the paths found. Right ...
2
votes
1answer
97 views

Retrieving XML data

I am using the following function to receive XML data from a URL. Is there a more efficient method for retrieving this XML data? ...
7
votes
1answer
707 views

Removing XML Doc Comment Nodes

I recently wrote a code fix to handle many of the C# and VB.NET compiler diagnostics that was merged into Roslyn. Because it handles both, I implemented it as an abstract class with only the sections ...
0
votes
1answer
41 views

Trigger breakpoint when string is not a Google-owned domain

Basically, I want the code to break when strLink doesn't contain any domains in the googleDomains link. The code seems to be ...
2
votes
1answer
76 views

Check if URL in a XML is accessible

With this code I am reading a XML-File that is on a server. In this XML-File are several links. I have to check them if they are accessible. For each link I add an item to a listview with a green ...
2
votes
0answers
27 views

Validate User By Comparing against SQL Data

I'm currently building a Windows Form Application using Visual Studio 2015 and the Visual Basic.NET programming language. On the main form there is a Tab Control and an ActiveX PDf viewer control. ...
3
votes
1answer
67 views

Class to hold data for a fund

Requirements: To store strings into variables, check if they are valid for the field. To be able to easily unit test the validity checks with different parameters. To throw exception when a check ...
0
votes
2answers
39 views

Streamlining button creation and Handlers

The code below works but I can not help thinking it's to 'clunky' and could be so much tidier! It's the first time I've really used AddHandler so go gentle... Create button(s) and handler(s) ...
1
vote
0answers
634 views

SSRS: code function to sanitise HTML for rendering in RDLC report

Background I have an RDLC that among other things displays text coming in that is captured in SharePoint, using a custom control (TinyMCE) that exposes limited formatting options to users. The SSRS ...
8
votes
1answer
175 views

Barcode (Code 128)

I wrote the code below to generate Code 128 barcodes, based on the specs. ...
3
votes
1answer
2k views

TCP server implementation in .NET

I wrote a couple programs in the past that use VB6's Winsock to achieve TCP communications, but still I'm kinda new to socket programming in .NET. I needed the same functionality of the Winsock to ...
1
vote
0answers
201 views

Business Access Layer and Data Access Layer for a database application

Would like to get your opinion and any advice regarding my current approach of creating database applications. Below find my current approach. Counting on your opinion and comments including examples ...