|
The array you are using hasn't been initialised, try
Dim myArray(15) as Integer
I find arrays cumbersome in .Net compaired to VB6 and so I tend to use ArrayLists or other collection methods instead.
An optimist's glass is half full.
A pessimist's glass is half empty.
An engineer goes and gets the right size glass.
|
|
|
|
|
How can make a 30 Days evalation copy of a windows based application which is developed in VB .Net 2003.
The thing is, after finishing 30 days of evaluation period,even though if the client changes his system's date the application should not work.
If anybody have any information,please help.
Joby Mathew
|
|
|
|
|
If somebody is prepared to change the date on their PC to run your program past the 30 day trial, then they aren't prepared to pay for it anyway.
They'll also happily run it in a VM and reinstall every 30 days...
|
|
|
|
|
I think u can use the registry
Try creating keys and assigning values when registered or unregistered
or the only way to combat this is to track from a central server and dat means all the client must be connected to the internet..rather bad
phatkin
|
|
|
|
|
Thank u very much for ur reply.I think better to go with the control over Number of Logins into the application.Anyway thank u once again for ur interest to give a reply.
Joby Mathew
|
|
|
|
|
how i transfer file from tcpserver to tcpclient?
thank's
|
|
|
|
|
You may use TCP class provided in .NET Framework
Try to search for "tcp vb.net sample" in MSDN and you will get the required sample.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
I have a checked list box that loads the first and last name into the list box in the displaymember property. Then it loads the id into the value member property. When I complile the program it wont load the first and last name.
If I comment the code to only show the first name the it displays the following in the checked list box instead of the name.
System.Data.DataRowView
It also shows the following error in a message box.
Conversion from string "clbTeachers.SelectedIndex" to type Integer is not valid.
When I click ok on the message box it displays the name and the same message box comes up again. When I click OK then the id number displays in the list box instead of the name.
I changed selectedIndex to selectedValue and removed some quotes that I missed and I stopped getting the conversion error. Now I get an error that says specified cast is not valid.
Why is this happening?
modified on Saturday, February 16, 2008 9:39 PM
|
|
|
|
|
AAGTHosting wrote: System.Data.DataRowView
is a type string, which is the default result of ToString() for many classes.
ToString() is called automatically by a lot of Controls to visualize an item
that is not a natural string.
Where is your data ("first and last name") coming from? an array? a list? a database?
why don't you show the relevant code?
clbTeachers.SelectedIndex isn't a string, so you can't apply a string-to-int conversion
to it. SelectedIndex is an index, hence an int; it does not need a conversion!
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
The data to fill the list box comes from a database. I use a data adapter to get the info from the database and then I fill a dataTable and get the info from the data table to the list box with the following code.
' fill the teachers checked list box<br />
clbTeachers.DataSource = dtTeach<br />
clbTeachers.DisplayMember = "teach_fname" ' & " " & "teach_lname"<br />
clbTeachers.ValueMember = "teach_id"
|
|
|
|
|
Hi,
a DisplayMember cannot be an arbitrary expression, it must be
"A String that specifies the name of a property or column in the data source specified in the DataSource property"
which means you may have to add a column to your database containing the first+last name
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Do you mean that I can't put multiple collumns from the data table or database in the display member property? Now, keep in mind, I still get the same error when I only populate the list box with the first name and comment the rest of the code.
I have been reading on the net about the specified cast is not valid error I am getting. It seems that this error is related to a check box. Do you think that this error may go away if I use a regular list box?
|
|
|
|
|
AAGTHosting wrote: Do you mean that I can't put multiple collumns from the data table or database in the display member property?
correct.
AAGTHosting wrote: Do you think that this error may go away if I use a regular list box?
correct. I haven't used this Control myself, but reading some documentation, I found
MSDN says "This property is not relevant for this class." for DataSource,
DisplayMember and ValueMember.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
In the database the teach_id is an int and the name is text.
|
|
|
|
|
I have an autocomplete textbox. When i press a certain key , it lists out several items.
But i have to scroll down the list to see all the items.What i want to know is that how can we increase the height of the listing?
Any idea guys?
|
|
|
|
|
Please don't crosspost. Are you using VB.NET or C# ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi everyone,
I'm trying to nail down an elusive error. In a thread I have a Try/Catch around part of it. In the Catch block I do a CurrentThread.Abort() because if there is an error then the thread can just quit.
Every now and then I'm seeing a "Thread was being aborted." error in the error log. I haven't yet been able to get the error during debug.
My question is, could calling CurrentThread.Abort() in the Catch block be throwing the "Thread was being aborted." error?
If you have any ideas or any suggestions on how to terminate a thread on an error please let me know.
Thanks!
|
|
|
|
|
The JZ wrote: could calling CurrentThread.Abort() in the Catch block be throwing the "Thread was being aborted." error?
Yes, of course.
The Abort method is supposed to be called outside the thread, and it throws a ThreadAbortException exception in the thread to abort it. The thread is supposed to catch the exception as a signal that it has been aborted.
To end the thread, just do this:
Exit Sub
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
|
Guffa wrote: Exit Sub
Yes, but what if the decision is to be made in a nested function?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Good point. You can only exit a thread like that from the main method running the thread.
If you are in a nested function you can either return a value from the function to indicate that the thread should be exited, or throw an exception (other than ThreadAbortedException) that you catch in the main method.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I was afraid that was going to be the answer.
It would be easier having say Thread.CurrentThread.Exit(); but that
is not available...
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I've put a sub main in my startup form, which I thought would be run on startup. But it doesn't seem to be. What am I doing wrong? Thanks
Public Class Form1
<stathread()> _
Shared Sub Main()
Console.WriteLine("MAIN SUB IS REACHED")
Try
Application.EnableVisualStyles()
Application.Run(New Form1())
Catch ex As Exception
Console.WriteLine("Main sub Error")
End Try
End Sub
End Class
|
|
|
|
|
Put the Sub Main in a module rather than a form.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|