|
Try pressing F8, I think it work for errors as well as the mulit-file find.
Gary
|
|
|
|
|
Thanks. F8 works.
Sincerely,
-Ron
|
|
|
|
|
No, but you had a choice the first time you started it to use different layouts / defaults, one of which was compatibility with Visual Studio 6. You can still change this from the Start page in VS.NET to default to a Visual Studio 6-like configuration.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks. I didn't know you could do that.
Sincerely,
-Ron
|
|
|
|
|
here's a complete list of all available shortcut keys
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxoriKeyboardShortcuts.asp
|
|
|
|
|
I am new to c#. I have created an class where an sql connection is opened in the constructor and is closed and disposed in the destructor.
However, it appears that the destructor is not being called when the object goes out of scope. It is not called until I close the form, at which time I get a "Handle is not initialized" error.
Is this the way this is supposed to work? If so, is it possible to have a class that opens a connection upon construction and automatically disposes of it?
|
|
|
|
|
Yes, this is the way it's supposed to work. The garbage collector "lazily" cleans up objects that are no longer in scope and have no references.
It is a much better practice to open your SQL connection only when you need it and close it when your done. Do not hold the connection open during the lifetime of your object.
RageInTheMachine9532
|
|
|
|
|
That's too bad. Since I tend to write wrappers around database connections, I guess my wrappers will have to include dispose functions as well.
I'm still not clear as to why the connection handle (which is private to the class and created in the constructor) would be lost before the destructor is called.
|
|
|
|
|
You're wrappers can simply open and close the connections as needed in your method implementations as well. We do that in our N-tier application quit often.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
An idle connection can timeout and be closed by the TCP/IP stack. Plus, it's much better practice to have your conneciton open only as long as your performing a transaction because each connection is using resources on the SQL Server as well as a connection license.
RageInTheMachine9532
|
|
|
|
|
This is by design. You'll need to implement the IDisposable interface. This makes it possible to perform deterministic cleanup by calling the Dispose method. Be sure to read "Implementing a Dispose Method"[^] in the documentation first. I've seen a lot of people do this incorrectly.
|
|
|
|
|
I get that too and it is really irritating me - i have just surrounded it with a try catch block and ignore it - I couldn't solve it and I got to the point where I just didn't care - I am not happy with ADO.NET at all - it's very poor.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Can anyone tell me how to get the system string size in C#? I know in C++ it's listed as a constanct in a header file.
Thanks
|
|
|
|
|
What do you mean the "system string"? You can use String.Length on a string instance to get how many characters there are. Internally strings are stored as Unicode, so there'll be 2 bytes per character. You can use the Encoding class to convert the encoding of the string, and can marshal these to unmanaged code by using the appropriate UnmanagedType enumeration member with the MarshalAsAttribute on parameters and fields. The TextInfo class may also be useful to enumerate code points within the string.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
About 2 gigabytes... (in bytes that is, so that's 1 Gb of DBCS (i.e. Unicode-16 (i.e. 2 bytes per character)))
I don't think you'll reach that limit quick, and if you do it might be a good time to look into some streaming classes.
Regards,
Jeroen Landheer.
|
|
|
|
|
when ever i want to change from design view to code view it goes through a save routine that last about 45 seconds at this rate ill never finish what is going wrong
|
|
|
|
|
This is at least the third time you've posted this question and I've already answered you once. Please quit asking over and over again. It's pointless to keep asking.
1. Abstract your TabPage s.
2. Quit using the designer and write some real code.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i agree but i am so far in with this page now and worried about the time scale it will take me to write all the code needed to create my page objects and as i work on my own and not with a team of skilled developers the learning curve takes that bit longer. I would love to be able to use a more OO concept.
|
|
|
|
|
Why would it take so long? You've already got all the initialize code. Create classes for each TabPage and copy the relevent code, paying a little attention to fixing any problems you might see in there.
Relying on the designer is not a good way to learn anything. You're not actually writing code in that case - the IDE is doing it for you. Here's a chance for a real learning experience.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
can i email some one the form to test it for me?
|
|
|
|
|
Hello All,
I am student from India. Right now i am working on one on course project in C# and COM+ components.In that project i want to implement security through any hardware like floppy or CD. I try the 'VOL' command from command line to get the hardware Volume serial number like Floppy or CD. I i notice one thing that it is not uniq. If u make ISO of that Floppy or CD and write it then the Volume serial number will be the same. So there is no uniqueness in this. I want to implement security in my code from any hardware. How can i implement that one. If any one have good Knowledge about that Please mail me at Hemant_Mane2003@yahllo.com.
And if there is more secure way than the encryption and decryption please sent me that stuff or guide me about that.
Thanking You.
(Hemant Uttam Mane)
|
|
|
|
|
See my article, Using XML Digital Signatures for Application Licensing[^]. You can include anything you want. You could, for example, using WMI to easily get the volume ID of the system partition (the partition from which the current OS is running) and have them send that as part of a request which you sign and send back. In your application - besides checking the validity of the license - you get the volume ID again and verify that the two are the same.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Because .NET uses the IL (intermediate Language), it can always be backwards engineered. You can use an obfuscator to make the code in the resulting executables less readable, but at one point the framework still needs the IL from the file... RemoteSoft has created a tool called Protector that creates C++ like files which are very dificult to backwards engineer. But that tool costs $1899 for 5 developers.....
If you just want to use crypto in your app, you could try this book:
.NET Security and Cryptography, by Peter Thorsteinson and G. Gnana Arun Ganesh. It covers all aspects of Crypto available in .NET and also the security model.
|
|
|
|
|
Hi gurus,
I am currently testing the TcpListener and TcpClient classes from System.Net.Socket to try to send data from a pc to another.
I have inserted a static control that displays the status of the connection.
I do the following code:
<br />
...<br />
Int32 port=Int32.Parse(txtPort.Text);<br />
NetworkStream stream=null;<br />
Socket socket=null;<br />
<br />
m_server=new TcpListener(IPAddress.Any, port);<br />
m_server.Start();<br />
<br />
while (true)<br />
{<br />
lblStatus.Text="Waiting for a connection...";<br />
Debug.WriteLine(lblStatus.Text);<br />
socket=m_server.AcceptSocket();<br />
<br />
...<br />
When I check the output I can see the message "Waiting for connection..." (that's what I wanted) but the form seems to be completely frozen once the call to socket=m_server.AcceptSocket() is done.
Should I write this function in a separate thread? Then the interface could answer to the OnPaint events like in C++? If I have to write a thread for what I'm doing, where I can I get a sample code for it?
Thanks for the help.
Best regards.
There is no spoon.
|
|
|
|
|
There's plenty of examples of threading socket connections here on CodeProject. When you get and set properties on a control or form, however, you must invoke the call so that it executes on the main UI thread otherwise you'll run into problems. See Control.Invoke and Control.InvokeRequired for more information and an example of how to use them.
Microsoft MVP, Visual C#
My Articles
|
|
|
|