IF Statement Dealing With "between Numbers"?
Mar 14, 2012
I really don't know how to put this in ... but i will do my best. what i am trying to do is basically build a statement that looks at a number and if its between number 1 and number 8 then the output would be " this is class C network " and if the number is between 9 and 16 the output would be " This is Class B Network"and finally if the number is between 17 and 24 the output should be " this is Class A Network"
this is the code that i got it to work except that part i have explained above :
[Code]...
View 2 Replies
ADVERTISEMENT
Sep 21, 2009
I've been messing around with prime numbers for a while now, but I now want to use massive numbers, say a few million digits in length. Is there a way of storing and performing mathematical functions with such large numbers? Is it even possible on my home computer? I read on another old thread, something about a big number library, but the links he gave are now dead.
View 4 Replies
Mar 12, 2012
I want a method of dealing with very, very, very big numbers (potentially a million digits). It is very cumbersome to deal with very big numbers in VB, would another language perhaps be better for that?
View 10 Replies
Oct 3, 2010
I addressed a meeting and used the following....she worked there for 17 years.I was corrected later that it should have been 16 years.I argued that the first year of this persons employment was 1966 and her last years work was 1982. Therefore 17 years.Does someone have an articulate mathmatic reasoning that explains dealing with inclusive numbers.
View 12 Replies
Jan 23, 2009
I'm trying to make a program that'll play the card game "War". I've started to code the dealing process, but it doesn't seem to be working. I currently have 3 comboboxes on the form each with numbers representing different cards, 1 that contains all the cards to be dealt, 1 that contains the user's cards, and 1 that contains the computer's cards. I plan to just draw random numbers from these comboboxes for the dealing. However, nothing happens when I click the tool-strip button that's supposed to deal the cards. [Code]
View 5 Replies
Sep 2, 2009
how to write a program that uses a Do while statement and a For ..... Next statement to print the numbers from 1 TO 10 step 3
View 2 Replies
Sep 10, 2010
If I have a datatable with 5000 rows for example can I do a select statement by row numbers. like paging throught it so I don't have to display all 5000 in the datagrid.. i want to go forward and back by 100 rows
vb.net 2008 (vs 2008)
For example:
dgInbox.DataSource = dsInbox.Tables("Inbox").select(between rows 200 and 300)
View 3 Replies
Jan 12, 2012
i am probably overthinking this but how can i check the textbox for either a 655 or 699 in the first 3 numbers in the textbox? The current code i how now works but displays an error if (im guessing) it doesnt find the other number in the textbox as well:
[Code]...
View 3 Replies
Jun 22, 2010
The application I'm doing requires me to "enter the size of an array in a TEXTBOX, then click a button, a list of random number would show up, then re-arrange from Lowest to Highest".For ex, i enter "5" in the TextBox, then an array or list of 5 random number will show up vertically on the ListBox. I already got this part done. Now the thing is, I have to make a For...Next statement to rearrange them from Lowest to Highest.
View 4 Replies
Sep 1, 2011
Am new to programming and i would like your help to this question. [b][color="Red"]Write a declaration statement of an array of integers to store 15 numbers. Initialise the first 5 values.
When I open the Visual Studio 2005 I don't see the template i.e. Win32 Applications, C++
View 11 Replies
Mar 10, 2009
I wrote a program to convert numbers to roman numerals but something in my code is making every number I put in return a ""I" roman numeral. Here's my code.
[Code]....
View 14 Replies
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
Jul 5, 2009
I recently found myself in a thread deling with convertions from decimal number to fractions... Being a bit too brusk and dismissing the idea at first.I have now implemented a structure based on code frm Javelia whithc can be seen in this thread.Solitare also proveided code that I eventually understood and was working.[URL]...it a step longer and developed a structure that can also implement calculating with fractions... My first try is also posted in the tread above...
The implimentation is far from perfect, as it does not deal with POW of fractions.. So if anybody has some ideas on hoe to do this with squer root and all pleas let me know and Ill update the code..
[Code]...
View 7 Replies
Apr 19, 2012
So I am making a file crypter so that I can encrypt my VB.NET Application that I am making so that people can't decompile it. I had made this in C# and am transfering it to VB.NET, Everything worked fine in C# but once I had re-written the code in VB.NET i get this error inside of my RC4 Encryption method:
'Arithmetic operation resulted in an overflow.'
The error is occuring here:
Dim t As Int64 = (s(i) + s(j)) Mod 256
This is the same code above in c#:
int t = (s[i] + s[j]) % 256;
Is there anyway to make that calculation with it erroring? And why does it work in C# but not VB.NET?
View 2 Replies
Jan 6, 2012
I have a function called Modify. It is delcared like so:Public Function Modify(Of SIMType As {New, DAOBase})(ByVal obj As DAOBase) As Boolean
You can see that this function is generic. It takes as a paramer a object that is a DAOBase or subclasses of DAOBase.Inside the modify function there is a call like so:
DAOToGP(obj)This is where the polymorphism comes into play. There are four or so subclasses I have created of DAOBase. I have written a DAOToGP() for each of these types. So in the Modify() function, when it calls the DAOToGP(obj), polymorphism should kick in and it should call the correct implementation of DAOToGP() depending on the type that I pass into Modify().
However, I get the following error:Error 20 Overload resolution failed because no accessible 'DAOToGP' can be called without a narrowing conversion:'Public Shared Function DAOToGP(distributor As Distributors) As Microsoft.Dynamics.GP.Vendor': Argument matching parameter 'distributor' narrows from 'SierraLib.DAOBase' to 'IMS.Distributors'.'Public Shared Function DAOToGP(product As Products) As Microsoft.Dynamics.GP.SalesItem': Argument matching parameter 'product' narrows from 'SierraLib.DAOBase' to 'IMS.Products'. C:Usersdvargo.SIERRAWOWIRESDocumentsVisual Studio 2010ProjectsSIMDev_2SIMIMSDVSIMLibGPGPSIMRunnerRunnersRunnerBase.vb 66 39 IMS
I am kind of at a loss here. I am not sure why it cant figure out which function to call.
View 2 Replies
Aug 23, 2011
my code works fine in JavaScript but doesn't work correctly in Firefox or safari and wondering why. What I'm doing is I have a loop going through each element and depending on the variable inside a text box just want to alert something. Like i said earlier this code works fine in IE. Here is the code below:
Here is an example of text box:
<asp:TextBox ID="txtMac" runat="server" req="yes" errMessage="Mac"/>
for (a = 0; a < theForm.elements.length; a++) {
if (theForm.elements[a].type == "text" && theForm.elements[a].req == "yes") {
alert("Made it here")
}
}
View 5 Replies
Jul 19, 2011
Problem dealing with apostrophe in filter?
View 5 Replies
Jul 30, 2009
I have a website and say a user comes along and fills out the form with bogus data. Then after he fills it out, he enters another one and another one and another one of bogus data. He's basically just trying to clog up the data base.
How is the best way to combat this? Would it make sense to when they submit the data track the IP address?
View 4 Replies
Jan 6, 2010
I sure this has been asked more then once... New to vb.net and I have been experimenting with a datetimepicker and how it looks at and deals with time. What I am trying to do is to add up my time (not worried about the date at all). I have it figured out and can get it to work so long as I do not go over 24 hours... and that is where my issue comes into play.
How do I display my total time in hours once it has gotten over 24 hours ( I do not want days.. just hours) for instance, a 40 hour work week, not 1 day and 16 hours.
[Code]...
View 2 Replies
Jun 10, 2009
A partner of ours is making a call to a web service that includes a parameter called token. Token is the result of an MD5 hash of two numbers, and helps us authenticate that the user using our partners system. Our partner asks the user for two strings, concatenates them, runs them through MD5, and then calls our web service. The result of the MD5 is the token, and it is submitted to us as a string.
We store valid tokens in a DB - since we use the SQL Server to compute the tokens on our end, SQL seemed to be happiest storing the tokens as a varbinary, which is its native result for an MD5 computation.
We have two pieces of code that attempt to do the same thing - run a select query that pulls out a value based on the token submitted. One uses a dynamic query (which is a problem), but it works. The other one attempts to do the same thing in a parameterized (safer) fashion, it does not work - it is unable to locate the token.
Here's the two competing attempts. First, the parameterized version which fails:
byteArrayToken = System.Text.UnicodeEncoding.Unicode.GetBytes(stringToken)
scSelectThing.CommandText = "select thing from tokenstable where token=@token"
Dim param As SqlParameter = scSelectThing.Parameters.Add("@token",
[Code].....
View 1 Replies
Feb 9, 2010
Some tables I am dealing with have null values and are throwing errors. So far ive tried a few solutions to deal with the nulls with no success.Here are the code samples from my efforts so far;
If (r("datemodified").Equals(DBNull.Value)) Then
datemodified = String.Empty
Else[code]....
i have ran the query and it is working ok (i.e all the cols exist)
View 2 Replies
Jan 12, 2012
Dim myreader As SqlDataReader = cmd.ExecuteReader
'read information from the database and give the values to the arguments(column_1, and column_2)
While myreader.Read
column_1 = myreader.GetString(1)
column_2 = myreader.GetString(2)
.....
I get an error when the data returned from myreader.GetString(2) is NULL. How do I check for nulls before assigning column_2 a value?
View 3 Replies
Aug 3, 2009
I'm trying to test a varbinary(max) field to see if it's null. I'm trying to figure out if it's a null or not in the select statement, hoping to avoid having to do this locally for every row of the returned dataset. This is the SQL I'm using,
[Code]....
View 1 Replies
Feb 1, 2010
Is there any way to convert null terminated string to normal string.I mean I can easily make a program to find the location of vbnull but there has to be a built in function for that.
View 15 Replies
Jul 8, 2010
Some tables I am dealing with have null values and are throwing errors. So far ive tried a few solutions to deal with the nulls with no success.
Here are the code samples from my efforts so far;
If (r("datemodified").Equals(DBNull.Value)) Then
datemodified = String.Empty
[code].....
View 1 Replies
Nov 20, 2009
Is it possible to translate the following C# code into VB.NET, using VB 9.0?
delegate Stream StreamOpenerDelegate(String name);
void Exec1()
{
WorkMethod( x => File.OpenRead(x));
[CODE]...
Can I do something like this?:
Private Delegate Function StreamOpenerDelegate(ByVal name As String) As Stream
Private Sub WorkMethod(ByVal d As StreamOpenerDelegate)
''
End Sub
[CODE]...
I'm trying to write some documentation, but I don't know VB syntax. Often I use Reflector to translate it, but I'm not sure it's working in this case. I'm also not clear on where I would need line continuation characters. In VB9, it's not possible to have multi-line lambdas (or Sub lambdas, which I did not ask about). In VB9, all lambdas return a value, and must be a single expression. This changes in VB10. VB10 will allow the above syntax, but VB9 will not. In VB9, if the logic involves multiple code lines, it must not be a lambda; you must put it into a named Function and reference it explicitly.
Like this:
Private Delegate Function StreamOpenerDelegate(ByVal name As String) As Stream
Private Sub WorkMethod(ByVal d As StreamOpenerDelegate)
''
End Sub
[CODE]...
View 1 Replies
Sep 20, 2010
I am using a stored procedure to fill a dataset with a large amount of data (47k rows and 8 columns). I am needing to fill two tables with the results of this stored proc.One table will have data representing 47k reps that currently have credit for a transaction. The other table will be a mirror copy of the 1st table with 47k reps that were supposed to get credit for a transaction. This application is going to take credit from one rep. and give the credit to the other rep record in the 2 mirrored datasets. It's taking 30 seconds for the data adapter fill method to return records to my application. I would like to reduce the amount of time it takes for this request to process.
[Code]...
View 8 Replies
Oct 24, 2009
1. I having a project dealing with MsAccess database.
2. Currently the project connect the db using table adapter/data adapter method.
3. When I called a Me.SubjectCourseTableAdapter.Fill(Me.ProgrammingDataSet.Subject_Course) at frmCourse, it return me error message "System. NullReferenceException was unhandled Message="Object reference not set to an instance of an object.""
4. This line of code is just the same at frmA. Wonder why it will cause error at frmB.Besides, which is the better way to connect access? data adapter or ado.net?
View 3 Replies
Jan 14, 2010
I have a main form which contains a few buttons...some of those buttons open up smaller forms...there is also a button for each of those smaller forms, which should let me bring the chosen form to the front and give it focus...basically like the tabs in your task bar let you switch between which program you are using...but I'm having trouble with this...I need to click the button 2 times before the form I want comes to the front...the first click removes focus from the currently activated form the second click then moves the form I want to the front.I need this to happen in one click..I[code] figured out the exact cause of the problem.it's due to the fact that the first click doesn't actually take effect since the child form has focus...so the first click actually just transfers focus to the main form...the second click does what it should.I knew it was going to be extremely obvious.so the question now becomes...how can I overcome this if that is possible at all...I know I've seen applications where I can still activate functions of the parent form in one click even if I have a child form open and focused.And it's basically what I need...it does what I want and lets me switch between child forms in one click...but it stuffs up the entire look of my parent form...the layout and colors get wacky...the transparency of certain things don't seem to work and my background image is gone..
View 7 Replies
Jan 30, 2012
Suppose I have two events:
Public Sub Control1Updated() Handles control1.TextChanged
control2.Text = SomeFunction(control1.Text)
End Sub
[code]....
Basically the pairs of {control1.Text, control2.Text} and {control2.Text, control1.Text} should be the same. If control1.Text is changed to let's say "a" then control2.Text is ALWAYS "b". If control2.Text is changed to "b" then control1.Text is ALWAYS "a". How do I achieve this with events without going into an infinite loop? [the best I can think of is to make a check if the other control.Text is already the desired value].
View 1 Replies