|
You could use a validator with a regular expression that only excepts number.
Do the code youself its more fun and you'll never learn otherwise.
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
I m getting this error "Because of security restrictions,the type System.Runtime.Remoting.ObjRef cannot be accessed."I have tried many things like
<clientproviders>
<formatter ref="binary">
<serverproviders>
<formatter ref="binary" typefilterlevel="Full">
writing this in XML or in source code file like
Hashtable props = new Hashtable();
props.Add( "port", "0" );
BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
chan = new TcpChannel( props, null, serverProvider );
ChannelServices.RegisterChannel( chan );
string url = String.Format( "tcp://{0}:9000/ChatServer", textServer.Text );
chatServer = (ChatApplication.ChatServerObject)Activator.GetObject( typeof(ChatApplication.ChatServerObject),url);
but it doesn't work.Itz urgent.Plz help.
Thanx in advance.
Rizvi
|
|
|
|
|
hi all,
I have a dataview where i have included sorting.
I need to have all the rows of a dataview (sorted values) as a XMLNodeList. How can i convert the dataview sorted values into a xmlnodelist.
Can anyone help me plz
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Good Day Sir/Maam,
I wish to ask a very basic question. As I understand, the Try-Catch method catches all the error exception thrown and execute something inside the catch clause. The basic try-catch example:
<br />
try<br />
{<br />
}<br />
catch<br />
{<br />
MessageBox.Show("ERROR!");<br />
}<br />
A more advance try catch is indicating the exception thrown..
<br />
try<br />
{<br />
}<br />
catch(some exception)<br />
{<br />
MessageBox.Show("ERROR!");<br />
}<br />
catch(another exception)<br />
{<br />
MessageBox.Show("ERROR!");<br />
}<br />
My Question is this, if I indicated what exceptions to catch (like in the example above), How can I tell the try-catch to catch even the exemptions that wasn't indicated.
I Mean, when comparing it to an If-ElseIf-Else statement, what is the equivalent of "ELSE" in try catch?
I hope im not confusing you.
Thank you in advance.
|
|
|
|
|
You can specify a specific exception, a base exception (that matches all specific exceptions that inherit from it), the base for all .NET exceptions, or no specific exception class at all:
try {
} catch(NullReferenceException ex) {
} catch(SystemException ex) {
} catch(Exception ex) {
} catch {
}
---
single minded; short sighted; long gone;
|
|
|
|
|
be very careful catching totally unexpected errors. Trapping errors and 'swallowing' them can lead to some very hard to find problems further down the road.
Russ
|
|
|
|
|
Hi,
yes, just specify one or more catch blocks; their order is important, the first one
that matches gets executed, the others not.
And in general dont ignore exceptions, i.e. dont create empty catch blocks; they
would completely hide a malfunction that sooner or later will puzzle you forever.
|
|
|
|
|
Totally Right! I once created a catch block that contains //Do Nothing then I created an unexpected exception and it took me 7 hours to find.
|
|
|
|
|
How can I disable the 'information dialog' that pops up before the print
preview form shows itself?
|
|
|
|
|
by not using PrintDialog at all.
|
|
|
|
|
how to capture packet in promiscus mode using dotnetwinpcap.dll.
coz i want to capture all the packets passing in the kernel level.
|
|
|
|
|
Hi,
I'm having a user control in .Net 2.0 created with Visual Studio 2005. Where would you place cleanup code? I ask because the partial file of the designer contains the Dispose method where I normally placed my cleanup code. But generally I'm trying to avoid to manually change the code of the Designer.cs files.
What are the common practices concerning this?
Robert
|
|
|
|
|
Hi,
When a form is disposed, all child controls are disposed. So you have hust to dispose the form.
HTH.
|
|
|
|
|
You can use the Disposed event to add an event handler that will be called when the controls is being disposed.
---
single minded; short sighted; long gone;
|
|
|
|
|
Good point. Should have thought of this myself. Although I normally try to override base functions instead of binding events in the user control/form itself this sound good in this particular case where the Dispose method is already overriden in the Designer code.
Thanks.
Robert
|
|
|
|
|
Hi friends, I am developing Shopping cart in ASP.NET. Whenever I am entering username and password in ASP.NET Login Control, the problem with focus is occured. I want to Login the user without requiring user to click LOGIN button....means whenever the user enters the username and password, and If he do enter, he should be Login.
Chintan Mistry
|
|
|
|
|
Try using cookies to store the login detail after first login. Search google as there are millions of example of ASP.NET cookies to store credential details.
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
I have a ListView in details view. I need the item to be in a different position than the default one so I have written de code for DrawItem event. The items show in the correct position but when I select one and move to another one the control doesn't refresh its contents very well.
This is the code in the DrawItem event
Rectangle r = e.Item.Bounds;<br />
<br />
int charIndex = this.richIzquierda.GetFirstCharIndexFromLine(Convert.ToInt32(e.Item.Tag));<br />
<br />
r.Y = this.richIzquierda.GetPositionFromCharIndex(charIndex).Y;<br />
<br />
if (e.Item.Selected)<br />
{<br />
e.Graphics.FillRectangle(Brushes.Blue, r);<br />
e.Graphics.DrawString(e.Item.Text, e.Item.Font, new SolidBrush(Color.White), r);<br />
e.DrawFocusRectangle();<br />
}<br />
else<br />
{<br />
e.Graphics.DrawString(e.Item.Text, e.Item.Font, new SolidBrush((sender as ListView).ForeColor), r);<br />
}
This is the control shown on screen Link
How can I fix this problem? Thanks
|
|
|
|
|
Hello,
I am currently developing a DVD Playback Windows Application using C#. I am using the "IDvdInfo2.GetCurrentLocation Method " to get the current location of Playback.
I have an option in the windows application which allows the user to go throu the DVD one step at the time. The following the code for this.
private void stepForwardToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
int hr;<br />
DvdPlayLocation theVariable;<br />
<br />
playState = PlayState.Paused;<br />
hr = videoStep.Step(1, null);<br />
dvdInfo.GetCurrentLocation(out theVariable);<br />
txtlogDvd.AppendText("bFrames : " + theVariable.timeCode.bFrames + "\r\n" +<br />
"bHours : " + theVariable.timeCode.bHours + "\r\n" +<br />
"bMinutes: " + theVariable.timeCode.bMinutes + "\r\n" +<br />
"bSeconds: " + theVariable.timeCode.bSeconds); <br />
}
Unfortunatly, the display value for the frame "bFrames" is only updated every 14 steps (Frames)!!! Therefore my famre number is wrong most of the time, expect the time it gets updated which is every 14 frames. Can someone be kind enough to tell me what is going on?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Why can't we use the protected / private modifiers on interface signatures?
company, work and everything else @ netis
|
|
|
|
|
Well, private would be pointless because the only thing that can access private members is the thing that declared it. Since an interface has no functionality what would you declare to be private that could be accessed?
You could use a similar argument for protected. The only thing that would be able to use a protected member would be things derived from the interface only. In that case, what would be the advantage?
|
|
|
|
|
For protected method signatures the advantage would be to not to expose the method to outside.
Check out this link[^] that discusess something similar.
company, work and everything else @ netis
|
|
|
|
|
Zoltan Balazs wrote: Check out this link[^] that discusess something similar.
They are not really private. The are publicly accessible when the object is cast to the appropriate interface. It is a mechanism to allow the disambiguation that may be needed if you inherit two different interfaces that happen to define the same member signature.
Zoltan Balazs wrote: For protected method signatures the advantage would be to not to expose the method to outside
But why would you need this on an interface? I can see this being useful on an abstract class (defining an abstract protected method) because the abstract class can contain some functionality and may wish to call the protected abstract method. The method details will be implemented in the derived class. But an interface contains no functionality, only member signatures. So it can have no advantages.
|
|
|
|
|
Colin Angus Mackay wrote: he method details will be implemented in the derived class. But an interface contains no functionality, only member signatures. So it can have no advantages.
As I see it:
- I would have an interface that defines signatures of required protected methods
- these protected methods will be implemented in all similar classes
- the functionality will be similar to abstract class with the advantage that the designer could work!
That is what pisses me... that when deriving from an abstract class that suits my needs I can't use the designer later on (because it derives from a class that can't be instanciated)!
company, work and everything else @ netis
|
|
|
|
|
Because the purpose of an interface is to specify members that a publically available to any code that uses a class that implements the interface.
There is no reason to force a class to implement anything for an interface that can't be used from the interface anyway.
---
single minded; short sighted; long gone;
|
|
|
|