Performing Task Between Two Date/times?

Oct 16, 2009

i'm trying to set a discount to a product between two dates / times.Is it possible to achieve it?Are there any examples

View 3 Replies


ADVERTISEMENT

Cancel A Task Which Is Not Performing Any Loop-based Statements?

Mar 27, 2012

I have an asynchronous task that is executing a function. The function does not contains any looping statements, but instead it is executing series of sql commands on sql server. Now, i have a button on my window that can cancel these sql operations. In other words, cancel the whole asynchronous task.

I know that this technique will require CancellationTokenSource and CancellationToken to cancel the task, but i've seen many examples on the internet and all of them are showing that the function that task is executing contains loop statements in which they are checking for IsCancellationRequested boolean property. But in my case, it is not so. My function does not have any loop statements in which i can do a check on this boolean property.

View 3 Replies

Run The Same Task 5000 Times Simultaneously

Sep 28, 2011

I have an app that I query a database for IP information, then Ping the IP's and log the results to a database. This takes a long time (testing with 200 takes about 5 minutes as they are all sites across public internet) due to waiting for response from 1 ping before sending the next ping for the next site.

[Code]...

View 5 Replies

Sql - Available Times From The Date Selected

Apr 18, 2012

I am creating a booking system, I have got it all working so that a user can select a date and a time and book, there are no restrictions so 100 people could book the same date and time.

My lecturer suggested to me that to make it so that just one person can book one time on one day the user will select a date and then the page will re-load with the times selector only showing the times which are available on this date.

I have done some tutorial work similar to this, however a little more basic showing the available slots using an except operation for example allavailableslots except bookedslots, but there was no restriction on dates, so it would just show all the times which havent been booked yet full stop. I think I will use an if statement but I am not too sure, dont really know where to start...

my tables and fields are as follows

App
Bookingid
Petid

[Code].....

View 1 Replies

VB 2008 Compairing 2 Date And Times?

Dec 2, 2009

im struggling a bit and was wondering if anyone can help. Im looking to compair 2 sets of datess and times, for examp2 textbox1 27/02/1980 23:00 and text box 2 having the real time date and time. But instead off having years days hours mins and seconds i want to display how many seconds has passed between the two date and times. Can anyone show me how this is done as i have no clue where to start.

View 3 Replies

Approach/data Type(s) For A Date And Two Times In .Net 4?

Aug 26, 2010

I've got a method which takes some parameters and generates some XML to be sent to an [archaic] web service.

[Code]...

View 1 Replies

Clicking On A Date Several Times And Have The Display Show Always?

Dec 16, 2010

clicking on a date several times and have the display show always

View 4 Replies

Display TImes Based On Selected Date?

Jul 11, 2011

I have to display the available times in a dropdownlist called "DDL_avalTime" based on the date selected in a ASP calendar.

How the program works is that when a User clicks a date form the caldendar, it checks the SQL database. In this case the table that I'm retrieving it from is "trainerbookings" from the column "trainingDateTime". The data type for this column is datetime.[code]...

View 1 Replies

File Creation/modified Date/times?

Mar 16, 2010

I created a background thread that constantly scans a specified folder for any .xls files that are created or modified. These files come from a vba macro in outlook that will automatically save the attachments of the mails in the this folder. This will update the modified date/time, or at least it seems to.

For Each fi In aryFi
fidate = System.IO.File.GetLastWriteTime(path & fi.ToString)
fidate1 = System.IO.File.GetCreationTime(path & fi.ToString)

[code]....

Everytime I check to the code, the fidate and fidate1 variables are indeed the correct dates/times of the file it's currently checking. It almost never gets inside the elseif block at runtime though.

View 1 Replies

VS 2008 : Get The Time Difference Between 2 Date & Times?

Jan 17, 2011

how to get the time difference between 2 date & times Where

from_time falls >= 22:00 of the From_date & the to_time falls <= 06 of the To_Date

for example:

From_Date = 01/01/2011 20:00 ' Where Work Started
To_Date = 02/01/2011 08:00 'Where Work Ended

Time_Covered_Between_22TO06_As_Night = 22:00 to 06:00 is 08:00 hrs How to equate it?

View 8 Replies

VS 2008 Duplicate Date And Times In A Datatable?

Jan 16, 2011

Having problems with a datatable which consists of multiple datalogger information. Within the datetime field there are as the name suggests listed date and times entry i.e. 12/01/11 22:56:56 ect ect.

Problem is i am graphing this and when ms chart reads the duplicate entries as a series. It doesnt like it and comes up with a slightly odd interpretation. I need to get the duplicate entries out to establish a single time series.

I was proposing to clone the original datatable and run a loop to remove the duplicates. I have been trying to do this for days and have played with a whole load of examples, without success. Can anyone point me in the right direction on this.

View 1 Replies

[2005] Date AND Time Picker - Only Be Used For Entering Dates Or Times But Not Both?

Mar 16, 2009

Is it just me or is it so that a DateTimePicker can only be used for entering dates or times but not both?

View 9 Replies

Is It Guaranteed That Task A Started Before TaskB Will Be Completed Before Task B

Nov 24, 2010

is it guaranted that a task A started before TaskB will be completed before task B assuming the task do the same level of operatons?or in other words is there a chance that a task B will finish before tast A in the assumption that the task calls the same procedure?

View 4 Replies

Enlarge An Image Up To 32 Times Or 64 Times Bigger Than Original?

Dec 12, 2011

I want to enlarge an image, possibly up to 32 times or 64 times bigger than original dimensions (so that the user can see each pixel) if possible. The following is a simple function that I have to enlarge an image.

Private Function xEnlarge(ByVal Source As Image, ByVal Rate As Double, Optional ByVal Quality As Drawing2D.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic) As Image

[Code].....

View 6 Replies

Forms :: Find If Times Is Between 2 Times?

May 13, 2009

I have just started using vb.net and I have a checked list box with times throughout the day shown as

00:00 - 00:14
00:15 - 00:29
00:30 - 00:44
00:45 - 00:59

What I am trying to find is a way to get the current time and find which list item it fits into. What I think I need to do is to first of all get the current time and then go through the list splitting each item into 2 times and seeing if the current time fits. For example: Split the item 00:00 - 00:14 to 00:00 and 00:14 and then check if the current time is more than 00:00:00 but less than 00:14:59 and if so do certain task.how to go about taking each list item and splitting it into 2 separate times so I can check between them?

View 2 Replies

.net - Performing An Inner Join?

May 20, 2009

I've trying to do an inner join select statement where I select two fields from a table, and than all the records of a field in a second table that have the same id as the first table.The code looks as follow:

Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Public Sub openDB()

[code]....

I get a an exception: "invalid bracketing of name [Vegetables Descriptions.DescID] if I take it out to make it look as follow I get a "Join expression not supported"

da = New OleDbDataAdapter("SELECT [Vegetables Descriptions.Task], [Vegetables Descriptions.Description], [TasksOcc.When] FROM [Vegetables Descriptions] INNER JOIN [TasksOcc] ON [DescID] = [DescID] WHERE [Vegetables Descriptions.VegeID] = vegeID", conn)

I tried folowing examples from the net but where unsuccessful.

View 3 Replies

C# - Performing An Audit Using Reflection?

Nov 11, 2010

I would like to perform an audit as part of a unit test that uses reflection to verify some assumptions, the basic-psuedo code for this would be as follows:

[Code]...

View 2 Replies

.net - Visual Studio 2008 Performing Like VBA?

Jun 30, 2011

I know about VSTO/VSTA, and I also know that some VBA functionality (with .NET syntax of course) can be done in .NET. There is definitely a learning curve going from VBA to .NET without VSTO. My question though is, can everything that is done in VBA somehow be recreated in .NET without VSTO?

The reason is because I am converting my VBA application into .NET for several reasons: I want to take advantage of OO, my class libraries will be better available for use, and for fun. I wouldn't be too happy if I got so far in only to learn of some limitations.

View 1 Replies

C# - Get Subset Of Elements After Performing Remove()?

Jun 21, 2009

If I have code like this (C# or VB.Net does not matter)

Dim e As IEnumerable(Of XElement) = _
From s In _dataSourceSettings.Elements _
Where s.Attribute("name").Value = toInsert.Attribute("name").Value
If e.Count > 0 Then
e.Remove()
End If

How do I get now new _dataSourceSettings without element that I removed?

View 1 Replies

Performing An INSERT Statement From .NET To Access 97 DB?

Feb 4, 2011

I am writing a INSERT Statement which will INSERT data into a Access 97 DB.Everytime i run the Statement from my VB.NET Code i always get Error in INSERT SyntaxI have narrowed it down to one DB Field - INSERT INTO TEMP (Size) VALUES ('" & varSize & "') - I have taken all the other variable out.

Is the fieldname "Size" a reserved name or anything in Access 97 and is there a way round this so my whole statement will work including the Size part?

I have some old VB6 code which was written by someone else who is doing the same insert but instead of INSERT they have created a VB6 RecSet and set all the values then used RecSet.Update to insert the row of data. Is there a VB.NET version of RecSet and Update.

View 2 Replies

Performing Some Tricky Math With Arrays?

Jul 26, 2010

I am writing a program that rolls those crazy many-sided dice for use in fantasy games, and I have come to a point in my work where I am completely stumped. I am hoping that some of the more seasoned VB programmers on these forums might be able to point me in the right direction.

If this explanation gets a bit lengthy, please forgive me; I tend to be long winded. The feature I am trying to implement is that every roll result can have one or more "damage types" associated with it, such as "Fire" or "Acid". If I rolled a dice with "Fire" as the type, and the resulting dice roll was a 4, this would result in an output string of "4[Fire]". If there are more than one type, they are separated by commas like "4[Fire,Acid]".

The problem is when performing math while keeping track of these types. For addition and subtraction, there is little problem, "4[Fire]" added to "4[Acid]" is simple "8(4[Fire], 4[Acid])", while "8[Cold]" minus "4[Fire]" will leave "4[Cold]". Still with me? The problem comes into play when we multiply or divide rolls with types together. If we multiply "4[Fire]" and "4[Acid]", we get "16[Fire,Acid]" which is different than either "Fire" or "Acid" alone. Similarly, if we divide that "16[Fire,Acid]" by "4[Fire]", we are left with "4[Acid]", but if we divide by "4[Cold]" instead we will have "4[Fire,Acid]"

So how do I go about keeping track of this? Some of the dice strings my parser can handle might have dozens of damage types that might need to be figured into the total results. The result should display the total for the entire calculation, with results per damage type tracked separately. Currently I am using code that parses the string data above so that every type name is stored in an array with a integer variable associated with it for the total of that damage type. So, for the string "4[Fire,Ice]" I am storing the info in a variable that holds the 4 and an array that holds "Fire" and "Ice".

View 17 Replies

Program Locking When Performing Some Tasks

Feb 3, 2011

I have a program that has the option to create a restore point. My problem is that when you click on it to do so, the program just locks up until it's finished creating the restore point. I have put a separate form on the program and it has a Marquee Progress Bar Control which I downloaded, so the idea is.

User clicks "Create Restore Point"

frmRestore.show
Marquee Progress Bar goes on and on while the restore point is created
Restore point is done
frmRestore.hide

The thing is, when you click create restore point, the form shows and the program just locks up, onces the restore point is created the form hides again. Could this problem be solved with a Background worker? To be honest I'm not completely sure what it does, I mucked around with the controls but can't seem to find anything useful.

View 3 Replies

Program Locking When Performing Some Tasks?

Nov 23, 2011

I have a program that has the option to create a restore point...My problem is that when you click on it to do so, the program just locks up until it's finished creating the restore point.

View 13 Replies

Timer_tick And Performing Button Click?

Jan 28, 2011

I would like to know about timer_tick function.I have one form(form1) with 2 buttons : button1 and save respectively. There are picturebox and a timer as well Upon form1 show, I would like to use ALT + printscreen to perform button1 click. Having said that, when button1 click, it will perform Clipboard.ContainsImage() which is in timer_click. How to ensure that I can use ALT + Printscreen and able to capture the image?

Initially this function will be activated when user press printscreen button and it will show the image captured. However I have amended to add a button to perform the same action (ALT + Printscreen) ---> perform button click..and capture screen:

[Code]...

View 5 Replies

VS 2005 Performing The Multiplication With Timespan?

Aug 20, 2009

I am trying to multiply timespan by an integer....

Private Sub wtothrs0_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles wtothrs0.MouseClick
Dim temp As TimeSpan = TimeSpan.Parse(ttothrs0.Text) + TimeSpan.Parse(wetothrs0.Text)
wtothrs0.Text = temp.ToString

[code]....

i gives the error mes "Input string was not in a correct format."

View 14 Replies

Performing An Action Before X(CLOSE) Button Will Be Press

Mar 28, 2011

Can I perform an action when the X (CLOSE BUTTON) will be press?ex.If he pressed the X button then a msgbox will prompt and will verify his action of closing the application.

View 1 Replies

Performing Batch Processing On Selected Files

Mar 11, 2012

I have created tool which performs batch processing on files that are selected. The sub routine I have defined in the code, now I want to implement a way through which I can select actions that I want to perform and then perform the actions. For example the list has multiple actions, like Open, Close, SaveAs, Resize, Color Correct etc. I should be able to select what all I want to do on each file and then perform this actions. Someone suggested me using delegates for this, but I cant use that since all my functions have different parameters. Ither option I had is to use a nested IfElse or Switch to determine which action is selected and call function according to it, but thats to heavy I think, is there any optimized a better way to do this.???

View 2 Replies

Performing Insert And Update On A DataTable Using LINQ

Jul 12, 2011

I am pretty new to using LINQ and have been trying it out querying my strongly typed DataTable.
I have managed to perform a 'Select' ok but was wondering if someone can point me in the right direction to do Insert and Updates. I'm not sure if LINQ is best doing an insert at all?

My Select code is as follows:

Dim results = From myRow In _dt.AsEnumerable() _
Where myRow.Language_key = Lang And _
myRow.Section_key = SectionKey And _

[Code]....

View 1 Replies

Reading In And Performing Calculations To Columns Of A CSV File

Apr 25, 2012

I haven't used VB in 2 years and have forgetten way too much, but I still understand quite a bit. I just can't synthesize it.

Anyways, here is what I am struggling to do.

I have a CSV file as formatted in the screenshot at this link:[URL]

Number of rows can change but the number of columns won't.


I need to:

1:read in a csv file

2:take the second column save the first and last number as a variables for computations (these numbers will be the smallest and largest numbers, respectively if that makes it easier to program)

3:put into the first column of a new array the following computations based on the 2nd column from the csv file computation=((array value-first number)/(last number-first number)*100)

4:add to first column the same computations again but +100 i.e. if the first row had a cell that had computed to 1 then the next number would be 101

5:add to first column again the same computations again but with an addition +100 (+200 total) this should cause the column to have numbers between 0 and 300

6:write column 3 of array to 2nd column of the new array

7:write column 4 of array to the end of 2nd column of the new array

8:write column 5 of array to the end of 2nd column of the new array

9:delete excess array space

10:write new array to txt file with delimiter of " " (a tab) with the same name as the previous file

I have been looking at this for 6 hours now and although I figured out how to read in a csv file, I was not able to figure out how to call up the individual values for computations.

I won't complain if you give me code but what I really want is an understanding of what I need to do to accomplish this.

View 1 Replies

Structure/component For Performing Complex Calculations?

May 24, 2010

I hope this is the right forum. I've been developing something for a while now, and I've hit some walls with the direction I was going. I'm not an expert in .Net, so I was hoping maybe there's a nice solution that I had no idea of its existance.

A little bit of background: I'm building a relatively large scale calculation component which used to be in a spreadsheet. It composes of about 1300 values, about 150 which are passed in to the component, and the remaining 1150 are calculated based on these inputs. However, these values can be in multiple rows, as in there will be multiple rows of these 1300 values. Aggregate calculations need to be performed on these rows on a regular basis. Right now I'm using a dataset to perform this since it supports multi-row calculations nicely, but it has its limitations. It doesn't support some of the mathematical functions that I need it to perform (such as exponential) and performing a calculation like a weighted average is a hassle because you need to add a new field for it. Furthermore it doesn't let you use custom variables in your expressions, so if you want to create an on/off switch for something you need to create a single row table and set up a relationship to it. Also I'm getting tired of the dataset designer being riddled with bugs, and it's obvious to me that it was not meant for calculations of this magnitude. Not being able to see the data type of the field in the designer is a minus too (you have to bring up the property window on that field). I looked in to just creating classes to perform this, but the problem is that it needs to be relatively dynamic, and the calculations need to refresh based on user inputs. The best way I can think of doing this is setting up the 1150 calculated variables as properties so that they will be calculated automatically. But, I'm afraid that this is going to fire off thousands of calculations each time any variable is accessed, which is going to be a rather significant performance hit.

So, my question is whether anyone knows of a good structure or component that I could use to achieve my goals. I apologize if I didn't do a very good job explaining my situation, so I'll try to elaborate on any of my explanations if anything is unclear.

View 5 Replies







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