|
I did a test and Control, for example, return the Class name (that is: "Control", I think I will do that...)
it's obvious with the stack trace anyway!
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
hi!!
I am trying to build an application using .net and C# which will allow me to push objects from my desktop to all nearby devices. Its like a program to alert all nearby devices.
I have been trying to find ways to access the bluetooth stack on my desktop using .net but havent been able to do so.
Can any one tell me how can i achieve this?
thanks
p.s :I am eagerly waiting a reply ..its kinda urgent!!
|
|
|
|
|
Hi to all,
How to use WinSocket Library (MSWinsockLib) in C# (along with it's events)? I am using .NET framework.
Best Regards & Thanks,
Aniket Salunkhe
|
|
|
|
|
Use the following namespaces:
System.Net
System.Net.Sockets
WinSock 2 is wrapped in these .NET aseemblies.
Best,
Jun
|
|
|
|
|
Hi,
Do u hv any ex. to send & rcv data ( simple text) between 2 PCs using Winsock Library.
Best Regards & thanks,
Aniket Salunkhe
|
|
|
|
|
Search CP for "socket" or "tcp". You'll get tons of artcile/code snippets.
Best,
Jun
|
|
|
|
|
|
The following question can, of course, apply to other types (Boolean, DateTime, Double, etc), but for the puruposes of my question, let's just talk about the Integer type.
In my programming travels, the situation frequently arises where I have a nullable integer field in a database that I need to be able to work with in my code. As you know, there is no equivalent null value for the Integer type in .Net, so as far as I can tell my options are to use one of the following types instead of Integer:
Object
SqlInt32
Nullable(Of Integer)
As I see it, each comes with drawbacks:
Object - isn't strongly typed and (I assume) is less efficient.
SqlInt32 - I have to use SqlDataReader.GetSqlInt32(), which requires specifying the column index, not the name. I don't like this because it makes maintenance just a little harder by having to keep up with column orders.
Nullable(Of Integer) - When a null value is encountered, an InvalidCastException occurs because there is no way to cast a System.DBNull to a Nullable(Of Integer). My only way around this is to test the column with IsDbNull(), before attempting to assign the value. It just really seems wrong to have to do this extra step to get a null to equal a null. One friend made a suggestion to write a helper class to keep the IsDbNull() tests hidden away, but this only helps to keep the code cleaner.
Does anybody have any good suggestions or ideas or resources to point me towards? Thanks for your time and help.
Anthony
|
|
|
|
|
Use the SqlInt32 or nullable int, which ever you like.
The extra step of checking for the null value that you are concerned about, has to be performed either way. If it's done in the code that creates the SqlInt32 structure or in your code doesn't matter.
---
b { font-weight: normal; }
|
|
|
|
|
Hallo,
Can anyone help me. I have a treeview with several nodes in it.
On update I remove nodes that should not be in the tree anymore and add new ones.
I delete with '_TreeView.Nodes.RemoveAt(nodeToRemove);'
When I do this the bounds of an other node which is still in the list are changed
to negative values, so it is not displayed anymore. The treeview seems to be "empty" even
if there are still elements in the nodes list.
Is there anything I do wrong or a way I can make the node visible again?
(a thing that most times work is several expands and collapses on this invisible node,
but this costs on one hand a lot of time and on the other hand does not work always)
Any suggestions?
Thank U very much!
Desertstar
|
|
|
|
|
Hi everyone,
I have a WinXP test system with MSMQ running in Workgroup mode and with the IIS component installed for HTTP messages. I'm writing a .NETCF2.0 app for PocketPC 2003 devices which needs to send messages to a queue on the XP system. This has to be done via HTTP, since our GPRS wireless connection filters other ports. I've put MSMQ into Workgroup mode because the PPC2003 units aren't logging in to the AD.
I have a private queue set up on the XP machine. I have a .NET desktop app running monitoring the queue. As I understand things, HTTP queues cannot be read from (only sent to). So, when the test app is reading from the queue, it uses a standard MACHINENAME\private$\queueName path. When it sends a test message, it switches this to a FORMATNAME:DIRECT=HTTP://MACHINENAME/msmq/private$/queueName path.
It looks like messages are sent OK from this test app via the HTTP path, as they appear next time the grid refreshes.
However, no matter what I've tried, the PocketPC app (using the same DIRECT=HTTP....etc. path) cannot send a message. The error is: "The queue does not exist or you do not have sufficient permissions to perform the operation."
A few things I've tried:
- Ensured that binary and srmp are enabled using visadm.exe on the
device
- Verified that the device can see the XP machine's IIS instance and
access pages via Pocket IE
- Used both hostname and IP address in the queue path URL.
Cheers,
Chris
|
|
|
|
|
In the good old days I'd do something like this
#ifdef DEBUG
// Bunch of debug only code
...
#endif
To be more specific, I have some debug spew that uses the System.Threading assembly. How would I exclude this in the debug case?
using System.Threading;
Also, I am using System.Diagnostics.Debug.WriteLine. Is it safe to assume that these calls be removed from my final assembly?
|
|
|
|
|
|
|
Like this:
#if DEBUG
Console.WriteLine("Debug version");
#endif
From what I can see in MSDN, the calls to Debug methods are not included in the release build (while calls to Trace methods are):
"If you use methods in the Debug class to print debugging information and check your logic with assertions, you can make your code more robust without impacting the performance and code size of your shipping product.
In Visual Studio 2005 projects, creating a debug build enables Debug . For information on how to disable Debug , see the Visual Studio 2005 documentation.
In contrast, in Visual Studio 2005 projects, Trace is enabled by default for both release and debug builds, so code is generated for all trace methods in both release and debug builds. Therefore, you can use Trace to instrument release builds."
---
b { font-weight: normal; }
|
|
|
|
|
You should check out the ConditionalAttribute[^], which allows you to cleanly separate conditionally compiled code from the regular code.
Josh
|
|
|
|
|
Hmm never heard of this before. Have you used it? What concerns me is two things: 1. You can't use an attribute in the middle of a code block for stuff like writing to console only during debug and 2. VS will automatically hide a section of code depending on what's defined for the current configuration. Does this work with the attribute as well?
Logifusion[^]
|
|
|
|
|
Dustin Metzgar wrote: 1. You can't use an attribute in the middle of a code block for stuff like writing to console only during debug
That's the whole point. The attribute allows you to remove debug-only (or whatever-only) code from your "real" code. Since I started using it, I almost never use preprocessor directives anymore because it is just so much cleaner to factor the test/debug code out.
Dustin Metzgar wrote: 2. VS will automatically hide a section of code depending on what's defined for the current configuration. Does this work with the attribute as well?
No, but if you put all of your Conditional methods in one #region, or in a partial class extension, you'll have the same effect.
Josh
|
|
|
|
|
I have a project that I'm trying to finish and I need help writing the volume 3.1416(r2xhx3.1416) can some one help.
thanks
wanda
|
|
|
|
|
School assignment?
What specifically is it that you need help with?
---
b { font-weight: normal; }
|
|
|
|
|
I am doing an application which is using remote invocation, with Invokemethod. When I invoke a method from a remote class, it gives me the exception TargetInvocationException. how can I find out what exception threw the remote class? I mention that I step into the code for the remote class, but there is no exception thrown when step through the method invoked. Also, I tried searching Google , CodeProject and MSDN, but with no success whatsoever.
Can anyone help me please?
|
|
|
|
|
ok. that was stupid for me. Just check the InnerException method. But now I have another problem encountered. When I do an InvokeMethod on a method which returns string[], everything's OK. But, when I InvokeMethod the same method, only this time returning Type[] (for example) , it gives me a TargetInvocationException. Can pls someone point me to some place where I can read all I need in order to understand about these kind of issues?
|
|
|
|
|
kreaThor wrote: Can pls someone point me to some place where I can read all I need in order to understand about these kind of issues?
That silver bullet does not exist. Welcome to the jungle.
josh
|
|
|
|
|
hi to all
I want to create my own popup menu in InternetExplorer
can anyone help me
|
|
|
|