|
i suggest using vb2008 instead of vb2005
as vb2008 is much better allowing better
control and many other things
TheMrProgrammer
|
|
|
|
|
Reply to the OP - I use C#
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Depends on what you're used to..
Motivation is the key to software development.
|
|
|
|
|
Wow. Those were really useful posts... Way to help out. BTW: VB.NET can do ANYTHING that C# can do. Anything.
The easiest way to do what you want is with a collection. I would also get rid of the timer and just use Now.timeOfDay to get the current time. Heres an example:
The example below needs the following controls on it's form:
Control Name
=================================
TextBox txtID
Button btnAdd
Button btnSave
ListBox lstResults
=================================
'Begin Code:
'============================================================================================================
Option Explicit On
Option Strict On
Public Class Form1
'Create a new structure to make saving our data easy.
Private Structure Competitor
Dim ID As String
Dim FinishTime As DateTime
End Structure
'Create a collection to hold all of the competitors.
'I like using collections instead of arrays because
'they're easy to resize
Dim myCompetitors As New Collection
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
'Create a competitor variable to temporarily hold the
'competitor we are adding.
Dim currentCompetitor As New Competitor
'Set their ID to the the text of the textbox
currentCompetitor.ID = txtID.Text
'Set the finish time to the current date/time
currentCompetitor.FinishTime = Now
'Add the competitor to the collection
myCompetitors.Add(currentCompetitor)
'Update the list of competitors/times
UpdateResults()
'Reset the textbox and give it focus
'so we don't have to click on anything
'to enter the next competitor.
txtID.Text = ""
txtID.Focus()
End Sub
Private Sub UpdateResults()
'This sub updates the listbox with all of
'the competitors in the collection.
'Clear the contents of the listbox
lstResults.Items.Clear()
'Loop through the collection, adding the competitors information
'to the listbox.
For Each currentCompetitor As Competitor In myCompetitors
'add the competitor's ID followed by the date and time of their finish.
'if you want to show just their time, you would
'change currentCompetitor.FinishTime.ToString to currentCompetitor.FinishTime.timeOfDay.ToString
lstResults.Items.Add("ID: " & currentCompetitor.ID.ToString & " Finish Time: " & currentCompetitor.FinishTime.ToString)
Next
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'Create a new SaveFileDialog to ask the user where to save the file.
'You could also create a String variable if you want to hard-code the
'location of the file.
Dim myFile As New SaveFileDialog
'Create a DialogResult to tell us which button on the SaveFileDialog they clicked.
Dim fileResult As DialogResult
'Set the SaveFileDialog to save the file as a .txt file.
myFile.Filter = "[*.txt] Text File|*.txt"
'Show the dialog and set the fileResult to the button they click
fileResult = myFile.ShowDialog
'If they clicked on the OK button, then...
If fileResult = Windows.Forms.DialogResult.OK Then
'...save the file!
FileOpen(1, myFile.FileName, OpenMode.Output)
'loop through the collection, saving a new line to the file
'as we go:
For Each currentCompetitor As Competitor In myCompetitors
PrintLine(1, "ID: " & currentCompetitor.ID.ToString & " Finish Time: " & currentCompetitor.FinishTime.ToString)
Next
'We're done saving, so close the file!
FileClose(1)
End If
End Sub
End Class
'===========================================================================================================
'End Code
I hope that's what you're looking for.
-Ray
|
|
|
|
|
How can I get a Kerberos ticket in VB.NET?
|
|
|
|
|
You're going to have to explain what you're doing, or trying to do with this. Your question, as it stands, covers a lot of ground and can't be answered in a single forum post.
|
|
|
|
|
Ask nicely. Seriously though, look up this link for documentation and these search results
|
|
|
|
|
Hello all,
I'm using Outlook 2000 and I'm trying to access data held on a customised Outlook task form held in a public folder.
I'm using the following code to get at what I need, and can see certain values via objTask, but I can't see where I get at other 'fields' used on the form. One of the fields, for example, is called "CC Ref", but I can't find where I can get at it.
Dim objOutlook As Outlook._Application
objOutlook = New Outlook.Application()
Dim objNS As Outlook._NameSpace = objOutlook.Session
Dim oAllPublicFolders As Outlook.MAPIFolder
Dim oPublicFolders As Outlook.MAPIFolder
Dim objCodeChangeRequests As Outlook.MAPIFolder
oPublicFolders = objNS.Folders.Item("Public Folders")
oAllPublicFolders = oPublicFolders.Folders.Item("All Public Folders")
objCodeChangeRequests = oAllPublicFolders.Folders.Item("Code Change Requests")
Dim objItems As Outlook.Items = objCodeChangeRequests.Items
Dim objTask As Outlook._TaskItem
objTask = objItems.GetFirst
Thanks in advance!
|
|
|
|
|
Found it ...
Dim objUP As Outlook.UserProperty
objUP = objTask.UserProperties.Item("CC Ref")
|
|
|
|
|
I am receiving this error at Runtime:
Retrieving the COM class factory for component with CLSID {FDD4C8C1-69C9-11D3-9DC8-525400E38CF9} failed due to the following error: 80040154.
What is the problem?
Thank you in advance.
Thayhor
|
|
|
|
|
Did you even try and research[^] this issues before posting!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all...
I want to scan an image and then search that image in a lots of image stored in database.
I want to know that how to compare two images and verify that both are same images or both are same images of a single person.
Suggest me how can I do this.
Thanks.
Gagan
|
|
|
|
|
Presumably you would read the image in as a binary blob. Then look for a facial recognition algorithm. If you're looking for a match of an entire person, then shape recognition might be useful to you as well
|
|
|
|
|
Thanks for your quick response.
But I have still some confusions. I don't know how to read image in as a binary blob.
So give me any example or tell me logic to read image in as a binary blob.
Thanks.
Gagan
|
|
|
|
|
Gagan.20 wrote: I don't know how to read image in as a binary blob.
Then the odds of you doing the rest of this task, are pretty damn close to zero.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
CG be generous, give him a link to one of your articles, you seem to have done and published a lot of work on graphics.
I was actually waiting for you to dip into this request given your predilection for graphics.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Adn this is the easy part! Google for "save image to database" and you'll find the technique documented thousands of time.
The rest of your requirements are university-grade research projects. You won't find much in the way of sample code to do those.
|
|
|
|
|
Hi to All,
sorry to say this is a cross post......But I have put here....coz may be there could be way in vb.net to do so...
I know my subject doesn't say much...All i need to know...is there any method so that the primary key of a table maintains its value after deletion of records.
Eg: if the table has primary key from 1-10. Now if I delete the row 1....primary key starts from 2-10....next time I insert a new record, it shoul generate the primary key as 1.
I am using VB.NET2005 with Ms acceess2007
Is there any function/way to do this....
Thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: next time I insert a new record, it shoul generate the primary key as 1
You are making a fundamental error in database/data design. Your primary key should have absolutely NO relevance other than as a place holder. It must not matter to you what the number is. Primary keys must be stupid, they must not be used for any other job than holding your data structures together.
If a missing number ,the deleted record 1, causes you a problem then your design is screwed, you are screwed, your application is screwed. Do some reading on the use of primary keys.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thnak you for your reply,
But, I believe primary keys are also having some value limitation(say if it is an integer, it is 4 byte at max)....So what happen when the number grows big in an real time APPLICATION. I guess it will give some irrelevant data.
Am I correct?. Please advice me
-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: Am I correct
Nope - the size of the primary key is irrelevant in the real world, MS at one stage recommended using GUIDs, Sybase used to randomly resets itself to a 6 digit key. In this case size doesn't matter, it's all about the quality of the data.
A primary key does not have to be an int - that's just the default.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If your primary key is an integer, are you REALLY going to have 2.14 BILLION records in that table?
|
|
|
|
|
Even if that would be the case, you'd add another bigint-column under the key
I are troll
|
|
|
|
|
Yes, in theory you would be able to run up to a limit with a long-integer (32 Bit). You get 4'294'967'296 different values. If you create every second one record of data, you can do that for more than 2 years. I dont say, that it's not possible, but its seldom relevant in a real world application. You would probably run out of storage anyway.
If you are scared about this, use a database-engine, that allows for 64 Bit integers or GUID's as primary keys.
Regards: Didi
|
|
|
|
|
I'm issuing a Web Request and the stream i receive in response is empty but when i navigate to the same URL in my browser it's working fine and returning the data. Bellow is the basic code i am using right now.
Dim req As HttpWebRequest = HttpWebRequest.Create("http://192.168.15.40/touchscreens/get.qsp?display=1")
Dim res As HttpWebResponse = req.GetResponse
Dim sr As New StreamReader(res.GetResponseStream)
Dim dataReturned As String = sr.ReadToEnd
sr.Close()
MsgBox(dataReturned)
What could be the problem? Thanks for your help!
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|