|
Hi all,
I have a datagridview. Currently I am using CellEndEdit event to handler the validation of each cell's value. May i know is there have an another way to do a cell validation ?
Any tips are welcome
regards
cocoonwls
|
|
|
|
|
DataGridView has CellValidating and CellValidated events. You can use them for cell validation.
|
|
|
|
|
Hello, thanks! Is gread!
modified on Thursday, May 15, 2008 2:52 AM
|
|
|
|
|
I am new programming and this is probably a stupid question but, how do you create a new form using a button?
I know I have learned it somewhere but I just simply forgot. Is it something like new Form = formname.Form I can't remember too well. Can anyone help?
|
|
|
|
|
I would recommend reading a beginners book at this point. I assume you don't have one, or you'd be referring to it.
Form1 f = new Form1();
f.ShowDialog();
Christian Graus
Please read this if you don't understand the answer I've given you
"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,
please refer me to a sample project (on the web) that is based on 3 layers, and data access code and bussiness code in it be clear.
I want to see a sample data access and bussiness code.
Best wishes
|
|
|
|
|
I think the ASP.NET forum would be the right place to ask this question, but even there, we are here to answer specific questions, not to send people projects. We'd be googling for it, same as you can.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 may i know what is the 0000000 mean?
CREATE PROCEDURE [users_retrieve]
@UserId bigint = 00000000,
|
|
|
|
|
zero. zip. Nada.
It's a default value. 0 would be fine.
In future, we have a SQL forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Maybe we need so many zeros to tell the compiler it's a bigint?
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
This is really a sql questrion by the look of it, but the zeros are the default value for the parameter if you do not pass it in.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
been making a small telnet admin application for a game server for a couple months and i'm extreamly impressed with it thus far. I have had one major issue which has finally beaten me sometimes (like all game servers) the server crashes, i can detect the exception and kill the socket. BUT i cannot re-connect until the application has ended.
I know its something to do with the socket keeping the local endpoint, even though it has been closed. I know this is the OS acting as it should, but i'm beaten to find out how to reconnect.
I'v had the reconnect in 3 states:
1) cannot access a disposed object (just close & beginConnect, no reconstruction of the socket)
2) Connection has already been established (CloseAndDuplicate - this happenes regaurdless of the IsConnected state)
3) BeginReceive is not called, (close -> re-construct the socket instantly)
i'v been monitoring the netstat for the connection and i'm not to sure what my targeted result is when i intend on re-connecting at the moment i'm just killing the connection as i have already tried to enter the CLOSE_WAIT state, in fairness i dont know enough about that side of things.
The code is pretty much the basic Async code provided via MSDN and snippets on this site.. If it is required let me know.
Many thanks
Sean
|
|
|
|
|
I'm not sure I understand if you're client-side or server-side... I can see uses for both in game server scenarios (client for running automated tasks against an existing telnet game server interface - server for providing a telnet interface for a local game server that doesn't have one) and your text doesn't make that very clear (at least not to me).
In any case - here are my two cents - for either scenario.
If you're client-side:
You should be able to reconnect immediately (as the new connection uses a new source port). However, if you try to reuse your socket, chances are that BAD things will happen. From the docs: "Call the Close method to free all managed and unmanaged resources associated with the Socket . Do not attempt to reuse the Socket after closing.". So... close your socket, replace it with a brand new one and start over. Shouldn't be a problem unless you gave away a reference to the socket to someone and can't make sure they replace it with a reference to your new socket (have seen that). Sorry... back to the drawing board in that case... no (trustworthy) workaround.
If you're server-side:
Try mySocket.LingerState = new LingerOption(false, 0); before calling Close . Otherwise, the socket will try to send any unsent data (holding the server TCP port busy) until the app terminates. Worked like a charm in my stacker crane management system (one of the crane PLCs for some reason insisted that I, the client, should be the TCP server and that it, the server, should be the TCP client - go figure). Had exactly the problem you describe every time I tried to do a warm restart (without exiting the app). No more.
Later,
--
Peter
|
|
|
|
|
It is client side, missed that vital info - sorry.
I cant make a new referance as the new referance retains the local endpoint, i have discovered this is normal behaviour of winsock.
Socket.Close()
........
Socket = new Socket(.....) results in a disposed object exception on BegingConnect(....)
While in bed last night unable to get this off my mind, i thought about the thread the async makes. I have appended a termintion char to the end of successfull calls and check for this in BeginReceive. The final call i make is a signal to logout, this offeres no response but the wait handle is still active looking for a response - would this cause a problem while trying to reconnect?
I'm going to investigate this later this afternoon when my desk is clear.
|
|
|
|
|
Ummm... I overlooked the endpoint thing. My TCP clients don't use the Endpoint class - I just use hostnames (or IP addresses as strings) and a port number. I also only use the TcpClient class (and the socket it presents), and I don't do asynchronous calls (as I'm already on a separate thread) although I'm working on a version that does. I recreate the TcpClient object (and anything depending on it) whenever the connection stalls (as per other peoples specs) or fails.
Just a thought (without looking in the docs): Can you recreate the endpoint object from IP address/hostname and port number before recreating the socket? Like I said, the client side picks a random available source port each time a connection is established, so it doesn't matter how many old connections to the same server (and service/port) that are lingering (yes, there's a "4 connections per destination" maximum enforced by Windows in order to make life a wee bit harder for network viruses, but that shouldn't be your problem) in the TCP/IP stack itself.
Again, this was without looking in the docs - I may be completely off...
--
Peter
|
|
|
|
|
I was going through the C:\WINDOWS\WinSxS\ directory and I noticed that the Manifests subdirectory has the following contents:
x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.manifest
x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb.manifest
x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest
x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2.manifest
I assume that the information after "CRT" in each manifest file name represents version information. I assume that updates simply add a new manifest version but keep the old ones (for backwards compatibility?). Is this correct?
Also, I noticed that each version has a related "Security Catalog" file. What is the point of this file and will I ever need to change it?
|
|
|
|
|
You never touch anyting in that folder.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
|
|
Please do not delete questions after they've been answered. It's considered rude.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
How do I get the protected override void OnMouseMove() event
to stop firing when the mouse has stopped moving over the parent application? Thx
modified on Wednesday, May 14, 2008 5:02 PM
|
|
|
|
|
You have described the method and not the event. If you register and unregister the event you should have no problems.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
By describing the method I wanted everyone to know that I was not registering an event, but using the native .net OnMouseMove method.
Why does it fire when the mouse is not moving?
Any suggestions?
|
|
|
|
|
Because it is designed to fire. The underlying class physically calls it every time a windows message comes for a mouse move. The only way to keep it from firing it to override the OnMessage? method and strip out the mouse move event.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|