The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
3
votes
2answers
2k 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
257 views

Updating every field of every page in a form

I have some VB code that connects to a MySQL database to update every control on every page of a form in our database. I am told this is taking longer than it should to run. The 'Setup MySql ...
4
votes
1answer
6k 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
181 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
220 views

Spelling bee test writer

Is there any way I can cut down on code? I'm new to this. ...
2
votes
5answers
19k 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
1k 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
478 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
1k views

Player VS player Tic-Tac-Toe game

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
5answers
1k 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 ...
4
votes
3answers
265 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 ...
3
votes
1answer
71 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
3answers
1k 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
535 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
1k views

Drawing a point on a chart

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. ...
3
votes
1answer
130 views

How To Subtract CBOT Grain Prices

I had to calculate the difference between Chicago Board of Trade grain futures prices using VB.net and came up with the following (admittedly clunky) solution. It's a little tricky because CBOT ...
0
votes
1answer
85 views

Manage Case Statement with (Int, long, short, double…)

I have the following case statements that has to be modified to fit these cases: Dec, Double, ...
2
votes
2answers
519 views

Better Way to Show and Hide Items in Project

I have this code snippet below that I am looking for a way to make smaller if possible. Any help or suggestions would be appreciated, thanks! ...
1
vote
1answer
2k views

Populating and saving checkboxlist items to the database

I have inherited an application that has code to save and populate values in an ASP.NET checkboxlist control. The existing code is very lengthy and does not appear to be efficient to me. I plan on ...
1
vote
1answer
2k views

Adding blank rows for every skipped value in a DataTable

So I have a DataTable that returns results within a month to month range when available. However, when I format the return, I need to still show skipped months as ...
6
votes
2answers
727 views

Adding to an index of authors

I'm new to SQLite but have programmed in BASIC (and other languages) for pushing 50 years. Given the sample code extract, please offer suggestions for improvement: ...
1
vote
1answer
93 views

Mixing Fowlers patterns

I am developing a large .NET app. The previous developer used Martin Fowlers Transaction script design pattern. Please see the code below: ...
2
votes
3answers
396 views

VB.NET | SQL Code Cleanup

I am trying to teach myself a new language in three weeks. Can you please give me some advice on how to clean my code and make it faster or more reliable? This works fine. I don't "need" any 'free' ...
2
votes
1answer
2k views

Screen resolution

I am working with an application that will have sub forms. The primary form opens above the system tray, and on mouse-over, secondary windows will open right next to the primary. When I use the ...
2
votes
1answer
1k views

Generating permutations with repetitions of string

I have written the below code which generates all possible permutations with repetitions of a string. I want to make this program shorter and much faster, but I don't know how to do that. ...
2
votes
2answers
85 views

Objects and instance variables in loops

Is there anything wrong with doing this: ...
4
votes
1answer
4k views

Handling of open database connection and calling shared function from WebAPI

I'm working on an ASP.NET project using VB.NET that uses Dapper and the code as implemented so far runs fine with just me testing. In the example below, Dapper calls a stored proc. But I am ...
1
vote
1answer
103 views

Regenerations in a game

This is for regenerating some things in a game a made. The code is very big and I think it can be compressed but I don't know how to do it. ...
2
votes
2answers
2k views

.NET - multiple DLLs and one namespace

Please have a look at the code below: ClassLibrary1 has a structure as follows: Namespace com.app.test Public Class Class1 End Class End Namespace ...
3
votes
1answer
167 views

I was wondering if there was a better way to improve my XNA joystick code? (Vb. Net)

I'm on a high school robotics team and I'm trying to code a Xbox 360 controller so that it'll controller the motors with variable speed. So far it works alright, but where I'm quite the novice coder I'...
2
votes
1answer
450 views

VB.Net interfacing with F# Euclidean Distance Algorithm

I testing F# code which calculates "nearness" of two N-dimensional points using a least square euclidean distance algorithm. The class library is written in F# and the calling will be from VB.NET. ...
1
vote
1answer
80 views

Creating a new item or updating an existing item on page load

When the page loads, it checks to see if the user is trying to update an existing book or create a new book. Something about my code just doesn't seem right. It feels cumbersome and not very logical....
3
votes
1answer
1k views

Is this the correct way to expose a setting for a vb.net class library?

I define in the Settings Tab of a VB.Net class library some user scoped settings. I want to expose these settings to other projects that reference the class library. I chose to do this using a public ...
2
votes
1answer
2k views

Using Statement for OleDB - Is this overkill?

I am still trying to wrap my head around good programming practice and just wrote this routine to read in an Excel file and return all the sheets into a dataset: ...
2
votes
1answer
2k views

A faster implementation of AcceptChanges?

So I started wondering why it takes 3.5 seconds to AcceptChanges for one changed record in a large DataTable. I wrote another ...
2
votes
1answer
253 views

Inherit SortedDictionary

As an example, suppose I had a large amount of data about a set of Restaurants for a large set of Dates in a database that I need to analyze / output to the user. I have a custom class that holds the ...
7
votes
2answers
381 views

Optimizing this Excel automation

The createReport method takes around 30 seconds to execute and I was wondering how I could optimize it. I'm using the ...
3
votes
1answer
167 views

OOP: Need tips of my approach in .Net

I am looking for some different approaches to this following OOP scenario. ...
4
votes
1answer
7k views

Writing a Data Access Layer

I am new to programming and have written this Data Access Layer. I am using this DAL in my projects. Now, I have a feeling that ...
4
votes
2answers
614 views

I have an encrypted file, how to remove a specific string from that file

I got a file with lots of ASCII characters. No extension, and has the Type Of file attribute 190000 File. I have many characters like L¿ö in the file however I required to remove lines from a word ...
2
votes
1answer
3k views

Method for populating ListViewSubItems

This is my current method for populating the sub-items of ListView controls. I like this method for two reasons... 1) I don't have to keep up with the display ...
3
votes
1answer
776 views

Finding patterns in a growing collection

If you look at the condition of If calculated Then in the code below, this is what slowing down the code. While the code provided seem fast with ...
2
votes
1answer
698 views

MEF composition with nested factories

I am implementing the Factory pattern for creating my objects and am trying to compose the factories using the AssemblyCatelog from MEF. The problem I have is that ...
2
votes
1answer
1k views

Datagrid not refreshing correctly with Async Ping VB .Net

I have an application coded in VB.NET that has a bunch of servers in a DataGridView and does a continuous asynchronous ping. If all the servers are up it refreshes great, but if one goes down and ...
1
vote
1answer
201 views

Managing web.config appSettings

I wanted a pattern to manage web.config appsettings. I want to be able to have a default setting if the config setting was missing. I also wanted the check for the value in the config file to happen ...
4
votes
3answers
135 views

Rewrite 2 repeating With-blocks

Got the following piece of code: ...
3
votes
3answers
5k views

Attempt to calculate age in VB.NET

I am working on an app where I have to calculate the age of a person. Inside of my age class I have a function that is designed to account for leap year. Is there anything I am missing or could ...
2
votes
1answer
2k views

Loading XML and csv files to datatables at startup

Here is some code that I put together for an app I am working on that loads 2 XML files and a large CVS file to a dataset at startup. It runs fairly fast, but I would like a second opinion on what I ...
1
vote
2answers
178 views

Inheriting needed when only difference is performed in the constructor?

I have a class that produces a key based on the two objects passed. The key for the items passed is simply the string of the ID (a GUID) for each object. There is also a subclass that makes sure any ...
1
vote
1answer
1k views

General insert function

I am new to VB.NET and one of the functions I wrote is below. The idea behind it is to just send a dictionary and table name to the function, get the result and then return. Is this good practice or ...