VS 2005 How To Implement Some IF/Then Logic
Mar 17, 2009
I'm sure this should be easy but I'm having trouble getting my head around it. I shall try to explain what I need as best I can.I have a string called SoftwareGroupName. If that string is empty, I need to run some code that logs a call in our Helpdesk. So far, so simple.I then check two other variables, AuthorityLevel and InstallType. If the AuthorityLevel is anything other than "OnRequest" then a call is logged in the Helpdesk System. Again, so far, so simple.
The problem occurs when the AuthorityLevel is "OnRequest". At this point, the application should again log a call in the Helpdesk Call with a status of "Resolved" as well as add the user to the relevant group in Active Directory.What I need to be able to do is, effectively, say "If the AuthorityLevel is OnRequest and SoftwareGroupName is not empty then go ahead and create the call and update the group. However, if softwaregroupname is empty then DON'T even try and update the group and create a call with a different status (e.g. Assigned).Here's what I'm doing so far. But it seems wrong to have to check that SoftwareGroupName is empty twice.
[Code]...
View 4 Replies
ADVERTISEMENT
Jan 26, 2012
I am going to be creating an application which will monitor a folder, which could be a network folder and when new files are added in that folder it will notify the application. On notification application will import those files names into a listbox and will give the option to user to organize(move) those files into a different directory.
1. I have to implement a logic for monitoring the new files in the folder.
2. I have to move it into new directory and in some cases I will have to create those new directories as user specify.
For the first step I am confused to either implement it as a windows service using FileSystemWatcher class, example can be seen here. [URL] or do a file check based on timer, lets say every 5 minutes. If I do it as a service how can the service notify application?
View 1 Replies
Aug 12, 2009
I am trying to implement a controlling design logic that prompts the user for a length and the area to calculate until he or she enters a number less than zero in the length to end.So far I have it where I believe it�s doing the calculations but it�s not ending when I input a number less than zero or zero.
Sub Main()
' Declare Length As Float
Dim Length As Double
' Declare s, c, t As Float
[code]....
View 4 Replies
Apr 10, 2011
the logic of this has gotten the best of me. In my scheduling app the user creates schedules for 6 groups(RNAM, RNPM, NTechAm, NTechPM, WCAM, WCPM). The user can then preview each schedule in a DGV on a separate form. After previewing all 6 schedules they then export them one at a time to excel. I want to do after the first schedule is done, is keep the workbook open and add a new worksheet for each remaining group(total of 6 worksheets).
[Code]...
Should I do away with checking if the file exists and just create the workbook and keep it open and then add all 6 worksheets by exporting them 1 at a time.
View 3 Replies
Nov 29, 2009
How to send logic 1 to pin 3 in Visual Studio 2005. In Visual Basic 6.0 code is simpe: TXD 1, or TXD 0, but I don't know how to do this in Visual Basic 2005, that's important that is logic 1 on PIN 3 of RS232 (serial COM port).
View 8 Replies
Nov 14, 2010
I am struggling with coding up a bit of logic.
I have a map which I have created zones which are basically rectangles which have the coordinates sorted
eg
Zone 1
Zone 2
Zone 3
I then want to create circles within the rectangles. So for example
Item1, Zone1
Item2, Zone1
Item3, Zone3
Item4, Zone2
Item5, Zone1
So i would like Item 1, 2 and 5 to show up as three circles and when the mouse cursor floats over them to show it. The item list is dynamic and so I am not sure how to get about with this?
View 7 Replies
Sep 3, 2010
The application uses ADO.NET to invoke sprocs for nearly every database operation. Some of these sprocs also contain a fair amount of domain logic. The data access logic for each domain entity resides in the domain class itself. ie, there is no decoupling between domain logic and data access logic. I'm looking to accomplish the following:
[Code]...
View 2 Replies
May 7, 2009
I have a program I wrote that copies select files from one remote computer to another.
The set up I for testing is, one computer(a) at home running the program connected to my work's network via VPN and two computers(b,c) at work side by side on the same network. I am trying to copy the files on computer b to computer c, while the program is running on computer a.
The only thing wrong with this is, the files seem to be caching to a temp folder on computer a then going to computer c. When it should be going straight from computer b to computer c. Is there a way to keep the files from trying to cache on the computer running the app?
View 1 Replies
Dec 31, 2010
I am trying to implement the following code to validate several textboxes The problem i cant figure out is once i get in an offending textbox and input the data i cant get out of it? I know i am probaly missing something simple but I can't seem to find it
HTML
Private Sub tb_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles subj_ba_txt.Validating, subj_bed_txt.Validating, subj_dom_txt.Validating, subj_gla_txt.Validating
Dim errorMsg As String = "Missing Data"
[code]....
View 2 Replies
Nov 30, 2009
I'm a newbie in visual basic. We have a project in our school in implementing queue using circular array.
View 5 Replies
May 24, 2012
I am trying to figure out a way to implement password protection on documents that a program I am working on creates. They should remain with the document regardless of where it is copied to or sent.Here is a rough sequence of events:
1. Application Opens (no document loaded).
2. User opens document with extension registered to application.(could also be # 1 if they clicked on the document directly)
3. Application Security checks document for security and prompts if necessary.
4. If prompted, user enters password.
5. Application checks password.
6. If passed, document opens, otherwise user is notified of failure.
View 4 Replies
Jan 19, 2012
In many of the articles I have read on the web say that when creating properties in vb.netthey should use the get/set methods and a private/protected member variable in the class.
Like so:
Public Class Person
Private _name as string
[code].....
View 3 Replies
May 1, 2009
in my page Having 4 Buttons ..(FIRST,PREVIOUS,NEXT,LAST) ..i am confusing to this one..
Actually what i am doing is Iam developing one efrom Designer in this user is adding pages..
so We have given These Buttons (before told)..so user click on First Button page goto Starting page and When click on Next Button Goto Next page ..like this
View 5 Replies
Oct 15, 2010
I have 3 tables:Sales data - SaleID, Date, StoreID, CategoryID, Cost, Retail
Store names - StoreID, Name
Category names - CategoryID, Name
I have a dgv bound to my sales table, and 2 comboboxes, one each bound to the remaining tables, with display member set to the name, and value member to the ID.
An ID of -1 represents "All Stores" or "All Categories"
An ID > -1 represents a specific location or category
So, can I use some sort of If,Then,Else logic to do something like this:
SELECT (*) FROM Sales
WHERE (IF @StoreID > -1 THEN StoreID = @StoreID ELSE True)
AND (IF @CategoryID > -1 THEN CategoryID = @CategoryID ELSE True)
AND Date BETWEEN @Date1 AND @Date2
I've found some different examples of If/Then/Else and Select Case type logic for SQL using google, but they don't seem to fit my situation, and I'm not sure how to apply that to what I'm attempting here.
View 2 Replies
Mar 4, 2012
I've got a problem when I'm trying to refresh my form. I've narrowed it down to why I'm getting this error so I'd be interested to hear people's opinions because logically, I don't think I'm approaching this the correct way.
I read from a table that gets x number of records. From the results, I create dynamic check boxes. It's OK if x is greater than the previous refresh but when it's less than, I can still see the old objects.
If I completely close the form and re-open it, it works fine and that is exactly what I'm trying to emulate. However, I'm failing miserably. Here's a broken down version[code]...
View 5 Replies
Oct 14, 2009
I have a datafield [Money] of datatype float.when i input currency value with $,or , it throws an error.How do I allow $ or "," to this field without changing the datatype(I know changing to type money may fix it)
View 3 Replies
Feb 28, 2011
While building an xml document I require to use logic to dictate the outcome of the xml; logically it is similar to the following piece of code (although this does not work):
Dim buildElement As Boolean = True
Dim xe As XElement = _
<xml>
[code]....
I have managed to do this using the method show below, is this the suggested way of doing this or is there a better one??
Dim buildElement As Boolean = True
Dim xe As XElement = _
<xml>
[code]....
View 1 Replies
May 2, 2010
How can i write logic to check is it my sql statement being insert into my database ? is there any ways to create or thing can check thru by using webservice?
View 13 Replies
Apr 10, 2012
I want to create a logic to calculate the age and unit from entered birth date. eg: If the difference between birth date and current date is >= 24 months, I will want it to display the age in years. If >= 8 weeks, I will want it to display it in months and so on here's my code
[Code].....
View 9 Replies
May 26, 2010
I have been programming in vb6 for few time ago and i used open SQL Server connection and command objects to make database transactions. I have been searching for similar approaches in vb.net too but not finding any starting point. How can we work similarly in vb.net application?
View 2 Replies
Jan 26, 2011
I never used POCOs, so I have the habit of putting a lot of logic in my business object classes. Hence I believe I'm missing some important concepts about class-layouts, and the thought-process that is needed here.
Say if you have two classes; Company and Employee. Could you give some examples of what classes you would build "around" these that take care of various behavior/validation etc.? (Like some class names, and a brief description of their purpose)
View 2 Replies
Apr 30, 2012
Looking at the following
Instead of a message box, how can I make it round when the unit price field is tabbed off of. If they tab in to the unit price field don't round, if they tab out of it, do.
Private Sub UnitPrice_LoseFocus(AllowLoseFocus As Boolean)
' Runs logic to round unit prices with long decimals
' Enter price rounding here
[Code]....
View 2 Replies
Apr 5, 2009
I want to be able to call forth hundreds of different photos be selecting them from a listbox or something of that nature.
Normally, if I only had a few images, I would amke their visibility false and then use If statements to turn on their visibility once it is selected. However, putting hundreds of images on to a form and then changing their visibility, seems like a pain.
I was wondering if there is a way to call forth each photo within the resources folder when an item is clicked so I don't have to put each one directly on the form.
View 5 Replies
Oct 7, 2009
We have a system were a user chooses a combination of days from a calander. We then insert a values in the databse based on the following [code]So if they picked Monday and Friday we would insert 34, or if they picked Monday,Tuesday and Thursday we would insert 22.Now my question is how do I reverse this easily in code, to find out what days they have picked. So I get fed 22 from the database how do I figure out what combination of days make up that value. The only thing I can think of is creating the mother of all case statements but I know there must be a better way.
View 4 Replies
Feb 3, 2011
I have an small physics toy application I am developing. It works fine except the particles will not push each other away, only pull towards, I debugged that sub going through it command by command and realised the value 'H' would not change, what ever it was set to during the first pass through the sub is what it kept, the only way to change this value is to manually set it i.e 'h = 1'. Once the calculation is redone on the 'H' value it resets to what it was previously, even though the x1,y1,x2,y2 are all different, thus meaning H should be different.
I think it is me that has made a mathematical mistake somewhere, but I cannot see where it is. I need a fresh pair of eyes to look over my work. Please let me know if you find anything.
[Code]...
View 1 Replies
May 12, 2010
I have a button on my form that loads a dialog. I have a logic on here that I want to test, what ever method I try I alway's get 'Object reference not set to an instance of an object'dialog1.vb:
Code:Public mainform As SettingsMainForm If mainform.LogicCheck.Checked Then textbox1.text = true End if
View 2 Replies
Nov 23, 2011
I am a student working in a co-op position. My project is to add a login page to an existing site (made using FrontPage, I believe) and I am using ASP.NET in vs2010 (VB). I would like to NOT use the login control/membership tools in ASP.NET. I was hoping to make my own login and use session variables to keep track of the users and determine their role off of a field in a table located in the database that currently exists for the site.
Like I said, I am still a student and haven't had a lot of web application experience. I'm not asking for someone to do this for me. I have spent a few days looking over the asp site, the msdn site, and several others but I just can't understand it yet.
View 1 Replies
Jul 22, 2009
I'd like for debugging purposes to be able to log what functions are called and in what order. So I've been just putting Debug.WriteLine("myFunctionName(args)") all over my functions, logging it in the end to a file. Isn't there a better approach to do this?
View 4 Replies
Aug 15, 2011
I am going mad trying to sort this logict
Public Sub Panels()
If RadPanelSearchCur.Visible = True Then
RadPanelTenant.Visible = False
'RadPanelProp.Visible = False
[code].....
the idea is if one panel is opened the others are closed?
View 3 Replies
Aug 10, 2008
I need to validate the users region against the region in the productlist. What I have is:
Several values stored in Session when a user logs in, one of which is Session("SLID") which is the users database primary key value and is used to perform a database lookup whenever a users info is needed. This is done via User.vb I am attaching the file
View 2 Replies