vb.net

Changing Program Logic to Accommodate New Retail Tax Law

Background I have a program that has implemented the two "classic" taxes for Ontario Canada: 5% GST and 8% PST. At the beginning of July (2010) the province switched to one combined HST tax of 13% for the most part. Effects and changes here but those aren't the main point of this question... Question What are best practices and good so...

WCF Not Binding to TCP Port (checking via netstat -a)

Okay, I'll try to make this as straight forward as possible. I'm using VB.Net in VS2010, I'm attempting to self-host a WCF service. (It's actually in a windows service, but I'm trying to do this via a simple console app. Below is the code in question, the TCP/IP addresses are injected directly here. The WCF service itself is simply a ...

How can I make folder available to only VB.NET application?

I have build a VB.NET application which uses PHP command line to run some scripts in a folder in the same directory. I do not want the script in PHP directory to be editable. So, I want that folder to be inaccessible by users or only available to my applicaiton. Any Idea how can I achieve this? ...

How to incorporate a batch file with vb.net

I wanted to make mysql dump files using a batch file and an app made through visual studio 2008. How can I incorporate this batch file or call it from vb? There is a code like this in vb.net but its using an absolute address: Process.Start("C:exe\execute.exe") How do I modify this so that I could just execute the file without providin...

listview printing

hi to all I have found some code using google for listview printing. I modified the code base on my needs. I have some problem if the list view more than one pages. It will not stop counting "Generating Previews" of my document. If I press the cancel it was display the data in multiple pages but the same content. Any suggestion would g...

C# Get VolumeSerialNumber

I am working on my HWID code. I recently tried converting this code from VB.net to C#. I have this one error which I can't seem to figure out. 'dsk' is a 'variable' but is used as a 'method' Here is my code string returnString = null; string systemDisk = Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Ma...

Upload files asynchronously with ASP.NET

I'm trying to make an asynchronous upload operation but I got this error message: Error occurred, info=An exception occurred during a WebClient request`. Here's the upload function: Private Sub UploadFile() Dim uploads As HttpFileCollection uploads = HttpContext.Current.Request.Files Dim uri As Uri = N...

round up given number in c#

I want round up given numbers in c# Ex: round(25)=50 round(250) = 500 round(725) = 1000 round(1200) = 1500 round(7125) = 7500 round(8550) = 9000 ...

Key down event of text box in VB.NET

Hello Everyone I have to use key down event on text box. Code for the event looks like this: Private Sub TextBox1_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles textBox1.KeyDown If e.KeyCode = keys.Enter Then MessageBox.Show("Hello") End If End Sub But it gives the following error...

how to use classes written in IronPython in VB.NET

I have a class (e.g. MksMath) written in IronPython using SharpDevelop 3.2. After compiling it for class library, it produced the following output: IronPython.dll IronPython.Modules.dll Microsoft.Dynamic.dll Microsoft.Scripting.Core.dll Microsoft.Scripting.Debugging.dll Microsoft.Scripting.dll Microsoft.Scripting.ExtensionAttribute.dll ...

Problems with huge CPU overhead

I'm writing an application in vb.net 2005. The app reads a spreadsheet into a DataSet with ADO.NET and uses a column of that table to populate a ListBox. When a ListBox Item is selected, the user will be presented with detailed information on the selected record. One part of this information isn't in the DataSet. I have to compare a col...

Redim boolean Array vs enumerate and set

Hi all, In a case where you would like to reset an array of boolean values what is faster, rediming the array or enumerating and resetting the values? I have run some tests and they seem to suggest that a redim is a lot faster but I am not convinced that it isnt a result of how I’m running the tests. My tests seem to suggest that re...

Windows service

Hi all.. I have written onw windows service..in that i have logic that is some part of code need to execute on certain time.. my service is running in every one min.. e.g. If (DateTime.Now.ToString("MM/dd/yyyy hh:mm") = "7/23/2010 1:10 ") Then 'execute this logic End If But iam facing prob that it is considering seconds whil...

Detecting Javascript html page modification in VB.NET Webbrowser control

Hello everyone My VB.NET code is supposed to execute third party Javascript code in an attempt to fill in and submit a form. This process consists of five steps, and I have been able to submit the form when all the steps are kept separate (i.e. behind 5 separate consequtive button clicks). Now, what I'd like to have is one button to han...

LINQ Cache issue

Hi There I am pretty new to LINQ and having a issue with what seems to be irregular content caching. The website in question has 6 content areas of different subjects now on the odd occasion the content just blanks out to nothing or has the same content for all 6 areas. It will clear up this issue by itself over time or the only other w...

[VB.NET] Automatically add namespace when adding new item

When adding a new item (class, control, etc) in C# it will automatically add a namespace to the file depending on the location in the project. Is this also available for VB.NET? The code 'Namespace DataClasses.AX' and 'End Namespace' would be generated. Namespace DataClasses.AX <Serializable()> _ Public Class AxInventItem #Re...

Adding new line to console output

In console application we write the statement as Console.WriteLine("the addition is {0}",i) it gives the output addition is 50 Now my question is: I want the answer to appear like this: addition is 50 How I will assign the output to the next line? ...

Why the template for a webform got a different behavior than the IDE?

If you open this zip file C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\VisualBasic\Web\1033\WebForm.zip in this file Default.aspx.vb you will see this code Public Partial Class $classname$ Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) H...

VB.net Automatic chart update with new data entry

my chart loads data from a datagridview. Please how can i automatically update my chart with new data if new values are inserted into the datagridview. Thanks my chart is binded to table1 and table 2 in my datagridview. my datagrid gets values from a datatable. here is a sample: Dim myData As New DataTable wcAdapter...

how to start new thread as soon as previously thread gets finished?

i have to develop windows service which will copy files to different servers. So i have to do this task using multi-theading. But i have to start only 3-4 threads. So whenever one threads get finished then i have to start new thread so that count of thread should remain 3 or 4. So how could i apply check on that ? please provide some inf...