|
hi,
You can surely find many online tips for writing the code..i am telling this becoz i am also working exactly with the same what you are expecting..My advice is, try yourself by searching in google so that you will get more ideas.
Regards...
Selva Shankar
|
|
|
|
|
I having some text files in a folder. I want to get all the files name and last modified date. how to get all files name and last modified date.
Jishith
|
|
|
|
|
Directory.GetFiles, from memory, then for each file, you would have to request the fileinfo to get the modified date.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have One listbox in my form. I have to send multiple data from listbox to database as user select one or morethan one value. Also If i click on Refresh button all the selectecd valuue diselect
.
|
|
|
|
|
Refresh button ? Is that part of your question an ASP.NET question ?
If you have to store more than one value, then you need to set up your db to take more than one value for a field, through a joining table, or by storing XML or something.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
nO, tHIS IS NOT A PART OF ASP.NET.
I HAVE A FORM WHERE I HAVE PUT A LISTBOX. IT DEPENDS ON THE USER HOW MANY LISTITEMS HE SELECTS, AND DEPEND ON THAT TRUE VALE I HAVE TO EXPORT THOSE NAME TO DATABASE. IN MAY DATABASE THERE IS ONLY ONE COLUMN FOR THAT FIELD.
I CAN PASS ONE VALUE BUT NOT MORE THAN ONE.
CAN U GIVE SOME CODE TO HELP ME OUT OF THIS PROBLEM.
|
|
|
|
|
I hope the caps lock was an accident - it is rude to yell at someone trying to help.
If you can select many items from a list box and have only one field to store the data it in how do you propose to acheive it?
CG suggested you create a link table which is a standard relational database structure. Or you could store the list as XML in one field (also suggested).
You are not asking a programming question, it is a design issue. Decide on the design and then code it appropriately. If you are looking for code to CRUD the database then you need to look harder, there are many article here which will help you.
[edit]
Ok so you asked exactly the same question earlier about checkboxes, did you think the answer would change for a list box? Listen to what you are being told.
[/edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As Mycroft said, hope the caps lock was an accident. Having the all caps is like shouting.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Yeh, It was by mistake i used the caps lock.
|
|
|
|
|
I have an assignment and I have been trying to get in touch with my professor to no avail. I missed last class and am totally behind. Any help would be appreciated. Here is the programming challenge:
Create an application that simulates a lottery. Should have an array of 5 integers and should generate a random number from 0-9 for each element in the array. The array is permitted to create duplicate values. The user should enter 5 digits which the application will compare to the numbers in the array. A form should be displayed showing how many of the digits matched. If all match, display a form proclaiming the user as the grand prize winner.
Thanx
|
|
|
|
|
Sounds really easy to me. Where are you stuck ? I don't see how I can give advice without telling you exactly how to do it. You create an array of 5 integers. You use a loop to specify values for all five using a random number generator. You ask for 5 numbers, then you check if those 5 are the five you have ( I guess you need to do some tricky stuff here, because duplicates are allowed ). Then you show a form at the end if they win.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thank you for the quick response. I am stuck with the array part of the problem. That is what I missed in class last week. I am new to programming and have very basic understanding of VB. I am not to great with loops either. Is there anything you can explain to me in layman's terms in regard to this program. Sorry I can't be more specific, I am in way over my head.
creelo
|
|
|
|
|
This is VB.NET, right ?
An array is a collection of objects, I am not sure of the syntax to create one in VB. I never use arrays because they are fixed size, I prefer to use a list. However, if you have an array of five objects, then they are accessed by index.
If n is your array, n(0) is the first int, and n(4) is the last one. So you create a loop, such as:
dim i as int
for(i = 0 to 4)
n(i) = i;
end for
This would assign the values of 0 to 4 to your five numbers.
Again, I don't do VB, so my syntax may be a little wrong, I'm doing the best I can
So, you will create an array of 5 ints. You will use a loop to assign random numbers to these values. He's allowing you to have duplicates to simplify the creation, you get a random number and you don't need to check if it's in there already. But, I would say the best way to check if the two sets are the same, is to iterate over both at once, and count how many times each of the 10 values is in there. If 0 is in the your lot twice, you need to count that it's also in the users selection twice, for example.
I would therefore create another array to store the users entry, to simplify the code that does the checking.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
creelo, I would suggest changing courses, if this is beyond you then you have a VERY steep learning curve in front of you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I would suggest changing courses
I second that. Not just changing courses but changing majors and career goals.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
This is how you create an array with ten items:
Dim lottery(9) As Integers
Now figure out how to change that so that it holds five items.
To create random numbers, create an instance of the Random class. The Next method is used to genereate a random number.
That should be enough to get you started. Once you get started you can ask more specific questions about your code, which is better suited for a fourm than a "how do I do my assignment" question...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Christian Graus wrote: Then you show a form at the end if they win
Let's not write redundant code now!
I had this project when I was 16 and programming in Turbo Pascal (what fun I had those days!) and even then we were told to compensate for duplicate values. Allowing duplicates makes the odds against winning almost infinte!
|
|
|
|
|
Thanks all for the help...ohh, and to Paul Conrad and Mycroft Holmes...the smarmy and brilliantly funny gentlemen who said I should switch majors and career goals. While I enjoy smugness as much as the next guy, I do not know why you would waste time writing such things if you were not going to help me with the question. For the record, I am an IT Helpdesk Support for a very good company, and I have a great amount of knowledge when it comes to computer software and hardware. I am not into programming but I did want to try it to see if I would like it.
I appreciate the concern and all, but I am not a programmer nor do I desire to be one. If you went on my website to find out how to fix your computer, I wouldnt bash you because you dont know something...but I am sure you two know everything anyway. You are knowledgable in every aspect of life. Two geniuses, trying to top the other.
Did that raise your self-esteem a little? I hope so...
|
|
|
|
|
Does anyone have any simple application on communicating with external device via virtual com port?
|
|
|
|
|
There's at least one article on CP about this, I am sure.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hi, the example u link me to is done by C programming. Is there any in vb.net language?
|
|
|
|
|
Actually, it's done in C# and should be easily translatable into VB.NET. Just Google for "C# to VB.NET conversion" and you'll find some online tools to do it. You will, of course, have to clean up the code by hand since no tool is 100% perfect.
|
|
|
|
|
You expect him to write actual code ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
No, not really!
|
|
|
|