|
SQL in visual studio 2005. its in mdf format.
Posted by The ANZAC
|
|
|
|
|
Use the Bit data type. In an SQL query it has the value 0 or 1, when accessed using parameters and returned in a data reader, it is represented as a boolean.
---
b { font-weight: normal; }
|
|
|
|
|
Great! Thankyou, that was my gut feeling, but helps to have confirmation. I tried it out, it works perfect thankyou.
Posted by The ANZAC
|
|
|
|
|
When writing a terminal emulation program of COM. A textbox is used as a terminal window for receiving and transmiting. All new text is .AppendText to the old one. This works fine and new text scrolling when total text length is within the .MaxLength range. But it stuck when this maxlength is reached. Have to manually clear the text then go on.
How to make the textbox works as a ring-buffer window? Discard the oldest text when maxlength is reached, and new text is added and scrolling in a line-by-line base?
Have tried richTextbox, only to find that the MaxLength attribute enlarged but the issue still exist. Do I have to handle all string[] by code, or is there an easy way? Thanks!
|
|
|
|
|
If text1.text.length + sNewText.length > text1.maxlength Then
text1.text=text1.substring(snewtext.length)
End If
text1.text &= sNewText
|
|
|
|
|
It works, only to change the 2nd line to:
text1.text=text1.text.substring(snewtext.length)
Tks
|
|
|
|
|
I'm currently developing freeware internet traffic monitoring program. Previously, I create Dial-up network (DUN) internet monitoring program using Delphi 6, you can download it at www.ia11.com/gprs.
Now, I rewrite the entire program using VB.NET and want to add universal traffic monitoring that monitor internet connection from both DUN and from LAN. I'm using System.Net.NetworkInformation.NetworkInterface to monitor specific network interface, but it cannot differ traffic from local and internet, so the statistic is not accurate.
How I can monitor internet traffic from any network interface (without selecting specific network interface) including from DUN? I need basic statistic like sent, receive, total sent, total receive, and speed. Thanks in advance.
Regards,
Irman Fauzi
web designer / web programmer
|
|
|
|
|
Hello,
Some parts of my VB.NET code that I used to compile with Visual Studio 2002 and the .Net Framework SDK 1.1 runs about 50% - 100% slower now that I am using VS 2005 / .Net 2.0.
All configuration/compilation settings are the same, I compared the old and new executables by running them outside VS.
The code that runs slower is code that runs on seperate threads, in some cases by using the ThreadPool (QueueUserWorkItem), in other cases by using Control.Invoke. More than 10 threads may be running at times.
Does anybody have any idea what may be causing this slowdown?
Thanks
Jim
|
|
|
|
|
Generally code compiled in framework 2.0 runs faster, as the compilers have gotten better at optimising, and the framework has improved. I remember reading somewhere about a 60% improvement.
What are you doing in the threads? Anything that might have changed from framework 1.1 to 2.0?
Anyway, if you want fast processing, threading is normally not the way to go, as the threading adds overhead.
---
b { font-weight: normal; }
|
|
|
|
|
The threads do lots of calculations (including math.log, math.exp and math.sqrt) and date/time manipulations (DateTime.Compare, .Substract,
.AddMonthts, .AddSeconds, TimeSpan.Compare, etc.).
Some GDI+ drawing also seems slower (i.e. Graphics.DrawLines).
|
|
|
|
|
Hi,
Guffa wrote: I remember reading somewhere about a 60% improvement.
slight improvements might be true but 60% is more a marketing wish than reality...
Robert
|
|
|
|
|
In fact, I did see clear speed improvements in other code (could very well have been 60% or more) but this was running on a dedicated thread.
All the code that has become slower either runs on a ThreadPool thread (so with background priority) or is called in the Paint event.
Meanwhile, I found that the slowdown is not being caused by any GDI+ methods nor probably any other specific framework things that I am using.
I am starting to suspect that from .Net 1.1 to 2.0 something has changed in the amount of priority given to background threads and/or Paint events.
Does anybody know of this?
|
|
|
|
|
I don't know anything about the priority for background threads, but I know that the Paint event is not run in a separate thread at all, but in the main thread of the application. The paint event goes through the regular message pump of Windows, so that hasn't changed at all. If the priority level of background threads has changed, that would of course be relative to the main thread, including the paint event.
Are you using any locking in your code? The code itself should not be running slower, so perhaps the threads are spending more time waiting for each other?
---
b { font-weight: normal; }
|
|
|
|
|
Amazing discovery:
The slowdown was not at all being caused by threading issues but by the fact that I was using jagged Object arrays and forgot to use CType when assigning values from the array to a (typed) variable.
I know it's not ideal to use the object type, but under .Net 1.1 this was certainly going a lot faster.
Anyway, the speedup by simply using CType (once for typing the object array as Object() and once more for typing the indexed element of that array as the correct type) is amazing, could be 1000%.
Thanks for the remark about the Paint event, that was useful to know in eliminating possible causes.
Jim
|
|
|
|
|
I see... so it added an implicit conversion, which is slow because it has to take any possible data type in consideration. VB is so helpful to add bad code instead of telling you that your code is wrong.
Use DirectCast instead of CType if you only want to specify the data type of existing data, and don't want to do any conversion. It's faster, and the code gets clearer.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Use DirectCast instead of CType if you only want to specify the data type of existing data, and don't want to do any conversion. It's faster, and the code gets clearer.
How much faster? I'm in a VB dev team here and we all use CType, as does the inherited codebase we're all working on. I read that DirectCast is faster. Any idea how much faster? I've not used it in case my co-developers find it odd.
Kevin
|
|
|
|
|
I was wondering if any of you could pass me a simple program for visual basic .NET, a very simple one, just using commands, like if, select case, strings, or cycles. I need desperate help with this, if any of you cold pass me a program send it to my email adress, lfpmx@msn.com. I would be grateful if you could help me with this, is very important. Thanks all of you for your help.
|
|
|
|
|
Why is that so very important?
I don't see how a program that doesn't do anything specific could be important for any real implementation. Is this a homework assignment that you are trying to make others do for you?
Anyway, expect replies in the forum, not to your email. The purpose of a forum is that people can cooperate to find an answer, and that other people than only you can benefit from it.
Also, try to write a subject that does anything towards distinguising the thread from other threads. Almost every thread in here is about someone who needs help, so that information is completely useless. Writing the subject in all capitals and appending it with a ridiculous amound of exclamation marks does not help.
---
b { font-weight: normal; }
|
|
|
|
|
lfpmx wrote: I was wondering if any of you could pass me a simple program for visual basic .NET, a very simple one, just using commands, like if, select case, strings, or cycles. I need desperate help with this, if any of you cold pass me a program send it to my email adress, lfpmx@msn.com. I would be grateful if you could help me with this, is very important. Thanks all of you for your help.
What is it that you are specifically having trouble with?
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
Tell us how to help, we can't just pop a program out of mid air for you. If you have questions about statements, make a list and everyone will answere them, this should give you a good understanding, also if you have limewire or something similar, try downloading visual bas for dummies book/document, This will help a great deal.
Posted by The ANZAC
|
|
|
|
|
How can you be "desperate" when you don't even describe any specific problem you want solved?
Kevin
|
|
|
|
|
Actually he didn't say that he is desperate, he only said that he needs "desperate help", what ever that is...
---
b { font-weight: normal; }
|
|
|
|
|
I stand corrected.
Kevin
|
|
|
|
|
lfpmx wrote: just using commands, like if, select case, strings, or cycles.
What on earth are cycles ?
The point of a class is that it gives you the info you need to complete an assignment. Ask your class mates if they are able to do the work. If so, then consider doing some extra work to catch up, and paying attention in future, or consider dropping the class and taking up pottery or something instead.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: What on earth are cycles?
I guess that they are loops.
---
b { font-weight: normal; }
|
|
|
|