Cleaning Up If Statements?

Jul 20, 2010

Basically if i wanted my controls to be checked at startup id use a setting obviously

'UI Settings
chkCloseToTray.Checked = My.Settings.CloseToTray
chkAlwaysShowSystemTrayIcon.Checked = My.Settings.AlwaysShowTrayIcon

[code].....

View 3 Replies


ADVERTISEMENT

Program That Will Generate A Pattern Using Do While / If Else Statements / Do Until Statements

Oct 11, 2009

Can someone give me a site to a tutorial that will help me write a program that will generate a pattern using do while, if else statements,and do until statements. I have been using google but I can't find anything. I need to generate patterns a certain size 6 by 6 or similar such as something like a checkerboard but where the ^ symbols is there a suppose to be a blank space..

View 3 Replies

.net :: Cleaning Up A String?

Feb 7, 2011

I have the following string which I need to get onto one line for database storage and retrieval purposes:

{"id":8,"heading":"heading goes here","content":"<p>
content goes here</p>
"}

[code].....

View 2 Replies

Asp.net - .net - RsData / Cleaning Up Code?

Mar 21, 2012

I have a question regarding VB.net and the use of rsData connections to an SQL database.Basically we have a few inline pages that will display course information of courses that my institution runs. The code will connect to an SQL DB and pull through live data directly in the following format.

html += "<tr><td>" & rsData("M_Start") & "</td><td>" & rsData("WEEKS") & "</td><td>" & rsData("DAYSTIME") & "</td></tr>"

Now I was wondering if people would suggest pulling directly from an open DB connection or map the RsData results to strings? All data connections open and close after they have done their required portions and we have around 5 different procedures that occur within the page.

View 1 Replies

Cleaning A String And Dots?

Jun 22, 2009

if i have a string like 12.4.23 how can i clean the dots? i want 12423

View 2 Replies

Cleaning And Sorting Out Game

Nov 21, 2011

I've been making a game using a Console Application as the main window, for the it. The game requires you to make the right choices in a mini Hacking adventure, but I'm rather stuck in an area where the player is required to enter the name of the file they would send and the program does not recognize the right one, also I was wondering how I could tidy up my code as It seems to be growing at a unnecessary rate.[code]

View 6 Replies

Cleaning Up Code With Functions?

Nov 28, 2010

I am just starting out with a practice VB project which involves selling donuts and coffee. I have written out the code which the program works but the code is very messy. This program contains functions and radio buttons to calculate a subtotal, tax, and total due. There are four variety of donuts in Group Box 1 listed as: Glazed at .65 each, Sugar at .65 each, Chocolate at .85 each, and Filled at $1.00.

The coffee choices in Group Box 2 are listed as: None at 0.00, Regular at $1.85, and Capuchino at $2.50 each.I want the cashier to be able to select a radio button to choose between the donut choice in group box 1 and then choose one coffee choice in group box 2. A textbox calculates the subtotal, a textbox calculates a tax of 3%, and a textbox calculates the total due adding the subtotal and tax.

Everything works fine but Ias I said before it is quite messy which I keep making it worst.I need to write one function to calculate the donut, one function to calculate the coffee, and one function to calculate the sales tax. Then I need a sub procedure to clear the subtotal, sales tax, and total due amounts when a radio button is clicked.I have been working on this for the past month ,code I have so far:

Class frmMain
Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()[code].....

View 4 Replies

Cleaning Up Open Programs

Sep 11, 2009

first, what is the base minimum that windows needs open to run... ex. svchost.exe, explorer, etc.

Second. is there an easier way to close all programs except the ones i want to stay open, i want to keep the needed basics open and my program, which will open other programs, but i want to make sure nothing else is running so that things will go as smoothly and as fast as possible. I just don't want to manually check what processes need killed and place them in the program one by one, i want to kill all but a few.

Extra credit... stopping all unneeded windows services would be nice too, but that would probably be too long of a process to worry about, and not really worth it considering the benefit of speed it would give.

View 3 Replies

Cleaning Visual Basic Code?

Jan 6, 2012

however there is a portion in this code that can be simplified more (the if orelse statements). I know it has something to do with a collections class or an array, but I'm stumped on how to change it.

Function GetLastName(ByVal accountName As String) As String
Dim lastName As
Dim stringArray As Array = accountName.Split(" ")

[code].....

View 1 Replies

Error Checking And Cleaning Program?

May 5, 2012

I've rearranged the error messages to different spots with no luck. The txt row need to be a number 1 to 10. The txtSeat need to be A,B,C, or D and the txtPassenger shouldn't be left empty.

Public Class Form1
Dim seat(9, 3) As String
Dim waitingList(9) As String
Dim passengerNames(9, 3) As String

[code]....

View 8 Replies

VS 2008 Cleaning Up A Nested For Each-loop?

Dec 3, 2009

I'm comparing a temporary table to an another table, to check for changes in the cells. The way I'm doing it, is that I'm using three loops; one to loop trough the temporary, one to loop trough the other table and a last one to loop trough each column. Here's the

vb.net
For Each row As DataRowView In View
For Each drow As DataRowView In view2

[Code]....

"emitid" is the column I use as a reference to be sure that I'm comparing the correct rows, and the column order will always be the same in both tables.

View 4 Replies

Reusing And Cleaning Up User.config Files?

Nov 11, 2010

Not sure if this has been asked before (couldn't find an answer), but is there a way to reuse a user.config file from a previous version of the application? For example a user.config file is stored in:

C:UsersJohnnyAppDataLocalCompanyApplicationName.exe_Url_wxcnyrmstqy3oj1qwckdjq3gjqkq4fel1.0.0.0user.config After a new version is installed it gets stored in:

C:UsersJohnnyAppDataLocalCompanyApplicationName.exe_Url_wglmejvw01nagu5t1y5yl12chynjomny1.0.0.1user.config The user then has to enter all settings again, even if the new version does not save more settings. An other problem is that although the user.config file is very small, it does get messy after a while when newer versions of the application get installed. Is there a way to clean up the unused user.config files and their folders?

It's the same problem with System.Windows.Forms.Application.LocalUserAppDataPath, that I'd like to use to save other files (containing Listview data), which points to:

C:UsersJohnnyAppDataLocalCompanyApplication1.0.0.0 The Listview data and other files created by the app can't be used anymore.This can be solved by getting the user's appdata folder with Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) and creating a new folder there with the name of the application. But this means there's one folder where the application is installed (user can choose this folder in the installer), one folder to save my own files to and one folder where VB stores the user.config file.

Can something be done about this "mess" or is this just something I have to live with?

View 2 Replies

If Statements Inside If Statements?

Mar 14, 2012

I am trying to figure out how to do this:

if (phrase = hello) then
"say hello"
if (phrase = how are you?) then

[CODE]...

So basically, I want it to work like a timeline. If I say hello, then it will respond and move onto the next if statement. Get it?

Here is the code I have now:

If phrase.Result.Text = "hello" Then

synth.Speak("Hello to you too")

If phrase.Result.Text.Contains("How are you") Then

[CODE]...

View 21 Replies

.net Cleaning Up My Own "Cache"?

Apr 21, 2010

I got a timer that saves like cache in a map and cant delete really cause it updates so quick that if i code to delete the folder and create a new emptey folder it craches cause "im already running /using that file"

Some one got an idea how to clean up? cause afterwhile it take a lot of space If you donīt Believe in it, Then it Doesīnt Exist!

View 4 Replies

For And Next Statements?

Oct 18, 2011

I have to Create a Bowling Scores application that allows the user to enter 5 scores and then displays the high score and the low score and then clicking on the Statistics button there would be a label showing which is higher and lower. We HAVE TO USE FOR AND NEXT STATEMENTS.

View 7 Replies

If Statements With > 0 < 44?

Nov 5, 2011

How can i implement a statement with if for this number to be greater than 0 but less than 10? More Specifically where would the < 10 go?

Quote:
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click

[code].....

View 12 Replies

Using 2 For Every Statements?

Dec 20, 2009

is there any way to use 2 for every.... statements?

i want to load up my.settings and 1 list will make new toolstripdropdownitem and the other lists is for the tooltiptexts

or I could do it another way, but how can I check the index of items in a my.setting string collection? like if I want to get the text of index number 3 how do I do that?

View 4 Replies

'if / Else Calculation Statements

Oct 6, 2010

I am using Microsoft Visual Studio 2008 with VB.NET, and in class we were assigned this project: A procedure should calculate a 2% price increase on all red shirts, but a 1% price increase on all other items. In addition to calculating the price increase, the procedure also should calculate the new price. You can use the variables strItemColr, strItem, decOrigPrice, decIncrease, and decNewPrice. Format the original price, price increase, and new price in the lblOriginal, lblIncrease, and lblNewPrice controls, respectively.

View 1 Replies

Combine 2 Statements

Oct 31, 2011

how to combine this 2 statment..

IsConnected("Select * from manager_table", False)
Call Loader()
IsConnected("Select * from Clerk_table", False)
Call Loader()

i hve 2 listview, 2 table from accessdatabase..i put listview in tabcontrol..1 in tab 1 & second in tab 2...

View 1 Replies

Database - SQL IF Statements In VB?

Oct 24, 2011

I need to know if this particular block of code will work, and if not, what i need to do to make it work. I'm doing touchy business and i'd prefer to have it right the first time.

strsql = "IF COL_LENGTH('orders','nosign') IS NULL" & _
"BEGIN" & _
"ALTER TABLE orders" >& _
"ADD nosign bit;" & _
"END"

View 2 Replies

How To Make OR Statements

Sep 21, 2011

How do I make an OR Statement.

Im trying to do this

name3 = [name2].EndsWith("," Or "." Or "?" Or "!" Or ";" Or ":")

View 1 Replies

If Statements With Or Boolean Value?

Apr 13, 2012

I just wanted to know if it's possible to get an if statement to accept two strings into the same text box. An example of my code so far is below: (although please note that the program does not accept the strings after the "Or" boolean)

Private Sub btnpreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpreview.Click
If cbox2.Checked Then

[code].....

View 5 Replies

Not Checking If Statements?

Jun 27, 2010

Okay I need two blocks of code for each of these:[code]Now both of these are under the if statements checking if the startsWith or equalsIgnoreCase check boxes are checked. (Only one is under the corresponding code not both.) At runtime when I check off the boxes neither of these two code blocks execute.

View 4 Replies

Pause Between If Statements?

Mar 17, 2011

Here is my code as I have it

Code:
Public Class Form1
Dim OpePro(7) As String

[code].....

View 8 Replies

Sql - Multiple If Statements, Then, Or Else?

May 3, 2011

I'm having some problems getting a query to run based off another query. Here's the database diagram to give a little background. The primary keys for all the tables are automatically generated by identites. The first 2 insert statements (Donation and Food_Donation) work but I can't get the last insert into Donation_Details to work. Here's the code so far:

View 2 Replies

Sql - Prepared Statements In .NET?

Sep 8, 2011

I cant really find any good sources for connecting to a database via connection string and executing prepared statements. Could someone show me an example or point me to a resource that might be useful?

View 2 Replies

Two If Statements - Why One Not Executing

Jun 27, 2012

I have two if statements and my project sees one and not the other. Here is the code:
If (IsPostBack) Then
HandleUploadedFile()
End If
Dim savePath As String = "Images "
If (fileUpload.HasFile) Then
[Code] .....
When I trace my code I find it goes to the second if and then go to end if without running the code inside the conditional.

View 2 Replies

Using IF Statements To Add Together Prices Using VB

Jan 29, 2012

I am trying to use if statements to add the prices of a cruises special packages together. I am using check boxes for the packages, so any, from none to all 3 are able to be checked. The packages available are VIP, excursion and restaurant. The price will also depend on the cruise length (7 or 10 day). I am wondering on which format to use, and if I even need to use if statements, how to make this statement true,

View 1 Replies

Using Like Statements For Strings

Nov 5, 2009

ok so i am in programming 1 and im trying to use a like statement for someone imputing a password and here is the details

-Changes all vowels to "X"
-Changes all numbers to "Z"
-Changes password to origonal form

i have tried but this is all i have

Dim vowelA As String
Dim vowelE As String
Dim vowelI As String

[Code]....

View 9 Replies

Using Multiplication In If And Then Statements?

Oct 5, 2009

I am very new VB .NET and just starting If statements. My problem is: Write an If statement that determines whether the variable CurrentBalance is greater then 1000.01. If it is, multiply the variable CurrentBalance by 1.005. Otherwise, multiply CurrentBalance by 1.007.So far I have

Sub Main()
Dim currentBalance As Boolean
System.Console.WriteLine("Enter Current Balance: " & currentBalance)
If CDbl(currentBalance) > 1000.01 Then

[code].....

I really don't even know if thats how I should be starting. Not sure what to put after the first Then on how to make it multiply currentBalance by 100.5.

View 5 Replies







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