VS 2010 Comparing Negative Numbers

Jan 22, 2012

I have this

[Code]...

All that is happening above is two players are being compared by scores and a winner is then decided. The calculation works fine and places the winner in the correct spot (txtWinner1.Text) as long as the numbers are positive. So if txtU1D.Text has 13 and txtU2D.Text has 14...txtU2 is the winner. Works with no problems. However, if txtU1 has -1 and txtU2 has -2...it says txtU2 is the winner. The negative scores are common in the game being played so the situation often happens, but may be one player only. It seems to work if one is positive and one is negative, but if both are negative it thinks the higher negative number is the winner for some reason. So it will give the win to someone who has -9 over someone who is -4.

View 4 Replies


ADVERTISEMENT

Show - Instead Of () For Negative Numbers?

May 10, 2011

What do I use for the format number function to show a - for negative numbers instead of ()?

View 2 Replies

.net - Format Negative Numbers In Parenthesis BUT NOT With $ Symbol?

Dec 1, 2011

I have seen all over the internet to format a NEGATIVE double value with a parenthesis WITH a $ symbol ie. currency type.

I am looking for a .NET format string, to format

12345.67 = 12,345.67
-12345.67 = (12,345.67)

View 2 Replies

Try-Catch Block Not Allowing Negative Numbers?

Sep 24, 2009

I have a program in which users are entering numbers into text boxes. I'm checking for proper data entry using a TRY-CATCH block. It works great and delivers an error message if the users enter anything non-numeric.

The problem is that now I need the users to enter negative values, but the TRY-CATCH is seeing the negative sign as non-numeric.

View 12 Replies

Random Numbers To Display Both Negative And Positive Integers

Feb 28, 2012

I have written a program that generates and prints 10 random integers from -10 to 10, my problem is that I am returning both negative and positive numbers, aligned right with a pad of 2, but the negative is on the right hand side of my number instead of the left. here is my code, all work but I need to align the numbers and have the correct notation of negative.

[Code]...

View 3 Replies

EPPlus Throwing Argument Exception (Negative Row And Column Numbers Are Not Allowed)

Oct 31, 2011

I'm using EPPlus 2.9.0.1 with Visual Basic.I have a DataTable with 35 Rows and 4 Columns and the code below:[code]When method 'LoadFromDataTable' is called, I get an ArgumentException (Negative row and Columns numbers are not allowed). I don't have negative numbers in row or column numbers, as far I know.

View 1 Replies

Comparing Numbers In Listboxes?

Jun 5, 2011

I am starting to feel completely dumb when it comes to VB.Net coding. I am using Visual Studio 2010 and am trying to compare the numbers in 2 listboxes. If an item from list A matches an item from list B, I want it to add that item to List C. Once it has added the item to List C, remove those searched items from list A & B. Continue until it runs out of numbers to check.

If you are wondering what I am trying to do, I want to make a Common Factor list. I already have the Factoring list done, but got stuck here.

So far, my code looks like

Private Sub CommonFactors(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Common.Click
Dim BoolAdd As Boolean, i As Double, j As Double

[Code].....

View 10 Replies

Vb 08 Express Case Statement - Take User Input, Validate To Ensure There's No Negative Numbers

Apr 9, 2011

CODE:

I need to take user input, validate to ensure there's no negative numbers and display monthly fee and check fee in a Label.....with a calculate button_Click

View 1 Replies

String.Format("{0:C2}", -1234) (Currency Format) Treats Negative Numbers As Positive?

Jun 16, 2009

I am using String.Format("{0:C2}", -1234)to format numbers.is always formats the amount to a positive number, while I want it to become $*-*1234

View 4 Replies

VS 2010 Error : Index Was Out Of Range. Must Be Non-negative And Less Than The Size Of The Collection

Dec 13, 2011

How would i make this code below work together i keep getting an error

Option Strict On
Public Class Form1
Dim Array(24) As Integer
Dim J As Integer = 0

[code]....

The error is get is at :

If MyArray(J) > Largest Then Error : Index was out of range. Must be non-negative and less than the size of the collection.

View 6 Replies

Why Is Data Table In 2010 And SQL Server Starting With A Negative Primary Key

May 26, 2011

I defined a database using SQL Server 2008 R2 Express, and connected to it using Visual Basic 2010 Express. For some reason though, when I use the database in the program, it wants to start off using a negative primary key.Is there any way to make the primary key only a positive number?

View 3 Replies

VS 2010 Comparing 2 Images - [BOOL]?

Jul 27, 2010

I have been searching many ways to compare 2 images and still I havent got anything usefull.

I was wondering how can I compare 2 images and either return TRUE or FALSE

is there like a DLL and I send 2 images and either return TRUE or FALSE?

View 18 Replies

VS 2010 Comparing Cells In Two Datatables?

May 2, 2011

I am wondering if there is a easy way of comparing data in two datatables available in following format:

datatable1

Quote:
ID Length Width Height Qty Rate
ID1 1.50 3.50 1.15 10 55
ID2 2.50 3.50 1.25 20 65
ID3 3.50 3.50 1.35 30 75

[Code]....

ID column of both the tables are unique ID's and can be used for comparing both the databtables.

I am wondering based on these ID's, both the datatables can be compared.

For example, if datatable 1 is used as reference table, data in ID2 and ID5 of datatable2 are different when compared in datatable 1

View 6 Replies

VS 2010 Comparing Data In 2 Columns?

Jun 29, 2011

i have imported some data from excel and into datagridview but does anybody know the code to compare data in 2 columns to see if they are equal and if they are not equal a messagebox would show "there are errors" else it would show "there is no error, you may continue".

the attached file is an example of the excel data i imported to datagridview.

View 10 Replies

VS 2010 Comparing Dates (SQL / Calendar)?

Jun 14, 2011

For the past day or so, I have been trying to compare values in my SQL server against an actual calendar. I have had mixed luck with this and I have exhausted my limited knowledge. I am looking for a shove in the right direction.

Background:Right now, I have a program that writes a record to a database when the program completes successfully. This time stamp has both the date and time on the SQL box. I want to grab that information and compare it against the basic calendar. I have attached a picture that should help explain things. This is just my test app,

[Code]...

View 16 Replies

VS 2010 Comparing Published Files?

Sep 15, 2011

We publish official documentation into pdf's, tiffs, and cals depending on the document type. Recently, we have discovered that somewhere in our publishing process, the system can hiccup and cause a character or two to become missing. It's intermittent and not consistent. We have a fix for it, but unfortunately have hundreds of thousands already published in the repository. It was brought up that we may want to consider developing a batch comparison tool that would compare a newly published version to the original published version to identify the problem documents. There was multiple thoughts on how to do this:

1.) Compare file sizes... unfortunately, any variation will cause the sizes to vary and small variations may not accurately reflect in it.

2.) Binary comparison... not sure how this would work at a file level like this

3.) Hash MD5 Compare... not sure how this would work either.

So I thought I'd ask those out there with some similar experience, what is the best way using the .Net Framework to compare one tiff to another, one pdf to another, and one cal to another?

View 1 Replies

VS 2010 : Comparing SQL Records Versus Calendar?

May 2, 2011

I have a program that backs-up remote locations to a centralized FTP server. Upon successful completion, a record is written to a SQL database with the following information:

GUID (uniqueidentifier)
StoreID (varchar(5))
DateStamp (sqldatetime)
ProgramAndVersion(varchar(50))

I am currently managing the program by running a report on who has written a record to the database. If the record is not written, I manually go in and backup the necessary files.The problem with this, is that it can take up to 30 minutes/day to do this task. While that's not a long time, it's getting somebody to be dedicated when I'm off and that has proven to be difficult.

I want the program to automatically search for missing records, but I'm not sure how to do this. I was thinking about bringing in the last 30 days with a SELECT statement and then comparing the information that I have in the SQL database versus a calendar control (or something). I need to make this process completely automated and not very intensive on the SQL server. I only have the following

2010
Sub FindMissingBackups(ByVal DaysToCheck As Integer, ByVal StoreNumber As String)
Dim TodaysDate As SqlDateTime = Now()
Dim PastDate As SqlDateTime = DateAdd(DateInterval.Day, -DaysToCheck, Now())

[code]....

View 1 Replies

VS 2010 Records Missing While Comparing Two Recordsets?

Mar 16, 2012

I have this piece of code which goal is to compare ALL records from recordset rs1 to ALL records of recordset rs2. Im doing something wrong because, when the code finishes I find that some records that fulfill the matching condition are not being considered as matched.

[code]...

View 7 Replies

VS 2010 Comparing Two Listboxes And Removing Identical Values?

Jun 19, 2011

how to compare two list boxes and remove identical values or add them to a 3rd list box, but for some reason it's not working when I retrieve the data from a mySQL database using ADODB, here's my work cut down by a fair bit for it to be easy to understand.

For k As Integer = lstFriends.Items.Count - 1 To 0 Step -1
If lstDBFriends.Items.Contains(lstFriends.Items(k)) Then
lstFriends.Items.RemoveAt(k)
End If
Next

I've tried everything from changing the data type on the mySQL database to storing the retrieved data from the database to String declaration and it simply wont compare the two listboxes

View 4 Replies

VS 2010 Comparing Current Time To Stored Time?

Mar 27, 2011

I'm writing a report scheduler that is somewhat of a clone to the backupexec scheduler and the layout can be seen in post #10 here: [URL]..It works great and saves/edits/deletes records just fine, but now i need to compare those records one at a time in a windows service that i'm writing in order to trigger automated report creation and emailing - i already have the report and i already have the code for the emailing, i'm just looking for the most efficient way to loop through the table (that i've pulled in to a dataset) and compare its records with the current date and time - if true, the event fires.

[Code]...

1stSun, 2ndSun etc are bit fields, time is a datetime, and the remainder are varchar. My service checks the database every thirty seconds.The english version of what i'm trying to do is "Connect to the database, grab the entire table (it will always only have 5-6 entries max, so i felt 30 second sweeps was okay), and If today is the 1st Sunday of the month, and it is currently 11:00:00 a.m. (could be any day or time, this is just an example) - loop through the dataset to identify if any records match the time field or greater - if they do, fire the report

View 2 Replies

VS 2010 Comparing JPG Image To An Image On A Specified Window?

Nov 19, 2011

I have a specific image that I want my application to look for on a specific window. I've done something similar to this along time ago with VB6, but it was slow, and it was checking for specific points in the picture rather than the whole image itself (for speed reasons). I named this image "Image1.jpg" and I want to compare it to the window with the handle "001C08F2" and class "SunAwtCanvas"

View 19 Replies

VS 2010 Sum Of Numbers?

Jul 8, 2011

I'm again got stuck in a simple problem, i'm learning it by myself. I didn't able to do it as i've tried many times. I'm making calculator. Please tell me what I'm doing wrong?

VB.Net
Dim total, num As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = Label1.Text &

[code]....

View 18 Replies

Comparing The 2 Images Without Actually Comparing Them Pixel By Pixel?

Mar 20, 2012

I have the code below on a timer( "b" is a bitmap )

If
Not (Clipboard.GetImage
Is
Nothing)

[Code]....

The problem is that it raises the event even if the picture didn't change.

comparing the 2 images without actually comparing them pixel by pixel (too slow to do the job)?

View 2 Replies

VS 2010 - Query For Even And Odd Numbers

Dec 1, 2011

"Select * from Table WHERE ItemNum=2 OR ItemNum=4 OR ItemNum=6"
I use the code above to select ItemNum w/ even number.. but the problem is how about 8 and above? The same with odd number?

View 2 Replies

VS 2010 : Sum Numbers In A Textfile?

Feb 24, 2011

I just got a textfile with a couple of numbers (1 number in one row), how would I sum these numbers? I thought it would be easy, but thing is it's turning out to be not so easy.

View 3 Replies

VS 2010 Add Multiple Numbers?

Nov 28, 2010

I am trying to write a console application that adds and undetermined amount of numbers together and then averages them and does some other calculations with them, but I cannot for the life of me figure out how to add many numbers together. I am doing this in a console application and using input boxes and message boxes to Receive and display the data. So the question is, How do I add many numbers together (an undetermined amount, maybe 5 numbers maybe 25 numbers) and then add them.

View 8 Replies

VS 2010 Calculate All The Numbers?

Apr 28, 2011

In the TextBox1 I have the following numbers:5 4.1 6.23 0 0 7 7.924

Possible to calculate all the numbers in this way?

like replace all the "space" in "+" and get the answer or something?

View 4 Replies

VS 2010 Two Random Numbers

Nov 23, 2010

every time i press the Roll Dice button the turn1roll1, turn1roll2, or turn2roll1, turn2roll2(depending on turn variable) it shows system.random in ASCII Chart i used the label names so no confusion.[code]

View 5 Replies

VS 2010 Way To Handle Numbers?

Dec 26, 2011

Only now, I'm facing this kind of problem, i have a application that until now worked with two different cultures ENG and PT, i always knew this, and i manage to solve all problems related to parsing the numbers, but now i have to change the code, and "protect" the code to handle with others cultures. So i need tips/best way to handle different cultures, and different database culture settings.I think that i shouldn't limit the user, by setting the decimal, the grouping digit, the date time format, etc. . The application should accept the numbers in the user current culture. But this path forces me to putting everywhere the parse/tryparse method.

View 1 Replies

VS 2010 : First Generate Random Numbers?

Oct 6, 2010

I have code to save records to my mysql database.But first I want to read what is the last number of record and add 1000 on that? What is the proper way to query that first. I want to make the result at unique ID of my clients. Here is my chunks of codes.

Private Sub addClient_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As MySqlConnection
conn = New MySqlConnection
With conn

[code]....

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved