|
hi,
I am using .net 1.1 version.
The problem is i have used one datagrid which contains some data columns and one checkbox column.
Datagrid contains nearly 50 records and 50 checkboxes.(i.e) each record contains checkbox.
below the datagrid an image button is placed.if i didn't select any checkboxes and click on the image button it should tell please select any two checkboxes for compare.
how to do this if i used .net 2.0 then the OnClientClick event can be used but i am using .net 1.1 so please any one help me....
Regards,
Prakash
|
|
|
|
|
Judging by the fact that you talk about OnClientClick, I would suggest that you would get better responses if you post your question in the Web Development forum.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Does the .NET version of VC++ compile into native code?
|
|
|
|
|
You can use Visual Studio (versions above 6, including C++ Express) to build either Win32 (=Native code) or CLR (=Managed .NET code) applications. Check under menu File/New/Project...
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
ok thanks. I have both VS6 Enterprise and VS.NET Express. Just not sure which I should go with for my, hopfully, commercial project. I can say VS6 Enterprise.
modified on Wednesday, August 12, 2009 4:29 PM
|
|
|
|
|
I'm not sure VS6 runs fine on recent Windows versions (Vista, 7).
Anyway, I decided against it some time ago; why keep it around as newer VS versions can handle the same job?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi All,
I hope i am posting in the right forum as i am looking for a .Net related solution rather than a pure XML solution.
I have the following class which i serialise using default XML serialisation.
Class UserA
UserID
UserName
Description
Comments
End Class
Later, my requirements changed and i had to generate 2 views of the same data.
In my 1st view, i would generate XML for the whole object (all 4 properties)
My 2nd view - include only UserID and UserName.
i modified the code as below
Interface iUser
UserID
UserName
End Class
Class UserA
Implements iUser
UserID implements iUser.UserID
UserName implements implements iUser.UserName
Description
Comments
End Class
I intended to serialise appropriate objects (iUser or UserA) based on my view requirements.
Unfortunately, i realised that XML serailisation does not work on interfaces - end to my dreams of getting it easy
My question is - if i have an Object instance, can i use any feature with serialisation to generate multiple views of an object?
I have ventured towards creating seperate classes, ISerializable, etc.
looking for suggestions on whats the best way to take this forward.
Thanks in advance.
modified on Thursday, August 13, 2009 4:23 AM
|
|
|
|
|
It might be worth bearing in mind that you can implement IXmlSerializable in an object and just dump that into the object hierachy you use the automated serializer for (XmlSerializer). The serializer will call the IXmlSerializable instead of using reflection, which means you could do your branching in there.
However, it could be a maintainance time bomb. ^^
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Its the maintenance i was worried about. But there appears to be no better way.
Many thanks for posting your suggestion.
|
|
|
|
|
Hi All,
I'll be happy to get your option on this, i have a webservice that uses Semaphore to access shared (VB) resources and i noticed that when there is an high volume of webservice calls the semaphore could no make locks using the WaitOne() method, when using it, it throws an exception "Thread was being aborted." after 2 minutes.
I believe its aprobably a timeout error, but not sure what is the cause..
Can someone please explain what effects the lock? why t could be completed? what effects the timeout and can i configure somthing on the code or IIS or machine level to prevent that?
Thanks
|
|
|
|
|
Member 3300969 wrote: high volume of webservice calls the semaphore could no make locks using the WaitOne()
Semaphore in a web service? it doesn't looks good to me.
Semaphore will only allow the specified number of threads at a same time. When more number of threads calls WaitOne() , it will be queued and processed only when some thread releases the lock.
Probably you should provide more information about your method like what it does and why semaphore is used, etc.
|
|
|
|
|
why not?
I need to provide access to unmanaged resource, the first thread works fine, locks, get the resource and release, the problem is with the second thread, when the first thread is still using the resource the second thread hangs on WaitOne.
any idea?
|
|
|
|
|
Do you want to give access to only one thread at a time? If yes, semaphore is not the right class. Use simple locking. Also try to minimize the time you spend inside critical section.
|
|
|
|
|
Member 3300969 wrote: I believe its aprobably a timeout error, but not sure what is the cause..
Probably waiting on the thread provided by the service handler, which
you shouldn't do. Webservice operations that take time or do any waiting
should be implemented asynchronously - then you'll have control over the
thread's lifetime.
I personally would focus on why anything is taking two minutes
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all, I have been asked to change the communication layer of our client server application from Remoting to WCF, and it is revealing a nightmare task because we are using everything that WCF doesn't like (interfaces, generics and so on).
Now I have a specific question regarding our architecture.
Currently, when the server starts it creates a remote object (singleton). When the client starts, it connects to the server, gets that remote object and request a new remote object wich will handle the communication with the server and the underlying database. So, one remote object is available for client to connect, and for each clien a new object is created. Client access this object through an interface to it.
This seems to be the wrong approach for WCF, as the server cannot create a server activated object wich will be then marshalled to the client through an interface: AFAIK object in WCF are always serialized, no matter if the derive from MarshallByRefObjec, no proxy will be created and the object will be serialized.
I was able to make that work using the NetDataContractAttribute, but the actual object implementation must be on the clien, and of course we would avoid to have all the server logic on the client (we would also it to be executed on the server, so that serialization/deserialization process does not really suit our needs). I suppose that we need a major refactoring of our architecture, so my question is:
which are our options to make this transition as easy as possible (that is, trying to keep our current architecture)?
Thank you all!
|
|
|
|
|
I have two threads and one will indicate to the other that it should perform some operation through a boolean flag. To set this flag I know it is necessary to have mutual exclusion so I use a monitor to restrict access to the flag and then exit the monitor.
Here is my question: a long time ago I remember that sometimes processors will cache their own copy of a variable and only fetch or write this value again when it is evicted from the cache (or memory or whatever) or when it knows something is volatile. My question is, do i have to indicate this boolean flag I am using in my monitor is volatile?
Regards,
Did I post well? Rate it! Did I post badly? Rate that too!
|
|
|
|
|
Rather than use a boolean flag why not use a ManualResetEvent or AutoResetEvent?
only two letters away from being an asset
|
|
|
|
|
I was more interested in it from a thought experiment perspective.
Did I post well? Rate it! Did I post badly? Rate that too!
|
|
|
|
|
Esmo2000 wrote: do i have to indicate this boolean flag I am using in my monitor is volatile?
Yes. Declare it like
volatile bool yourFlag = false;
Other option is to work with Thread.VolatileRead[^]. In fact, in C# if you use volatile keyword, it will be using VolatileRead and VolatileWrite .
As Mark suggested, you can try EventWaitHandle as well. Make sure you understand the difference of AutoResetEvent and ManualResetEvent before you make a choice.
|
|
|
|
|
No offense but most of what you said is untrue on some level..
You don't need mutual exclusion for a bool
x86's don't care about "volatile" and have no notion of it (MTRRs control caching, but the cache is coherent anyway), the "volatile" keyword makes sure that the value is actually fetched (that can be from the cache, but it doesn't matter, since it's coherent anyway) instead of reused if it is already in a register (and the same for writing) and guarantees that those operations won't be reordered by the compiler (the CPU can still reorder it, but only under some circumstances)
It's all very complicated. Unless you want to do assembly programming it usually isn't even relevant, especially if you'd just use the existing synchronization primitives.. see below.
Just making the bool volatile should usually be enough, since it's just a bool, and you may not even need that (usually works anyway, but better be safe than sorry)
However, I don't have a lot of information here go to on, but usually you should use normal synchronization primitives when dealing with synchronization, instead of making one up out of a bool. Like ManualResetEvent, or one of the static functions in Interlocked (if you need something low-level). At least, that's what I got told
ps: I'm sorry for any inaccuracies in this post, it is a complex subject, and I'm not even an expert on this
|
|
|
|
|
yes, you need one of two things:
- either make the flag volatile, i.e. non-cacheable, to make sure you aren't using stale data. The disadvantage is you still have to poll it, wasting a lot of CPU cycles;
- or use a real synchronization primitive such as a Manual/AutoResetEvent, as Mark indicated.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: i.e. non-cacheable
While it's not actually wrong (it can't be cached in a register anymore), it might give the impression that it has something to do with the cache..
Bit a nitpick maybe, but it would a shame if people were to assume that "volatile" makes uncachable memory ranges (which is AFAIK the only way to not cache something at all, non-temporal hints are just hints)
|
|
|
|
|
the exact meaning of volatile is a well-kept secret, manuals aren't clear on the subject; the best description would be: each read or write operation in code must result in an actual read or write from/to actual memory (in the same order), so all registers, and cache levels are to be ignored/disabled somehow.
Another way of putting it is: the compiler should assume the current code is NOT the only one operating on the data, hence every time the data is touched, it has to be fetched/written.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: Another way of putting it is: the compiler should assume the current code is NOT the only one operating on the data, hence every time the data is touched, it has to be fetched/written.
It's worth noting that, at least in C, any time the value of a variable is read the compiler is required to generate a read instruction [i]even if the value is ignored[/i]. On hardware platforms with memory-mapped I/O (very rare for the X86, but common with microcontrollers) reads certain addresses will trigger various effects. For example, on some machines reading the lower byte of a multi-byte hardware counter will latch the read registers for all bytes; even if code is only interested in the upper bytes of the counter, it may have to read the lower byte to trigger the latch. Even though such hardware is rare in the PC world, accessing a memory location while ignoring the value may have two potentially-useful effects:
-1- Forcing the page containing that location to be loaded into memory.
-2- Validating the address as pointing to something accessible.
Most programs won't worry about #1, but in some cases it may be good to minimize the likelihood of a page fault occurring while a resource is held. Pre-accessing a memory location before acquiring the resource may be helpful; even though there'd be no guarantee the page holding the location wouldn't get swapped out before it was actually used, the likelihood of a page fault occurring before the resource was allocated would be reduced.
|
|
|
|
|
Hi there. In my company, we have a windows service app that relies on multiple threads functionality to process many socket requests at a time, using the Socket events OnDataArrival to proccess the arriving data.
Although the system is working properly, the server administrator is complaining that the app process is using a very high number of handles. That is, when you open the Windows Task Manager and check for the Handles column, the number is around 30000 handles for the process. I've checked some sources and a reasonable number of Handles for a single process is around 3000, and a 8000 is already a very high number. I'm way too over this.
Do anyone has some good sources relating .net threads and events with the use of OS handles? I need some hints on how to low the number of hanldes for the process. I should probably re-do the app with good threading pratices (the implementation is very old), but I need a faster solution for the actual service.
Regards,
Leonardo Muzzi
|
|
|
|
|