|
When ever you create a form and show it, a reference to the form is added internaly. There is a property of Application Object named "OpenForms" which returns a read only FormsCollection containing all the forms opened by the application. Since a reference is held to the form object even though your local variable is collected by gc, the form does not get collected. You can access the form through that collection and call the close method on it to close the form. Then the form is removed from the OpenForms collection and will be collected by the gc.
HTH
|
|
|
|
|
Thanks. I understand now; You can reach to the form by Application.OpenForms[1] .
This makes sense
|
|
|
|
|
dear ali rafiee
please send the mail for me
I am not speck EN language
i'm sorry for me
then
send mail to Dehghani.Fazel@gmail.com
or
o2_ir@yahoo.com
thanks
|
|
|
|
|
Maybe you should contact him through his member page or through which ever of his ten articles is interesting you?
Dave
|
|
|
|
|
For the record, when you get spam on those two addresses, it won't be from CP, it will be from people who scour the web looking for people dumb enough to post email addresses publically.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
When i added a datagrid to my form on the left side it display an asterisk before the very fast column. Is there anyway i can eliminate it. Thanks
|
|
|
|
|
netJP12L wrote: Is there anyway i can eliminate it.
Try looking at the properties of the control.
led mike
|
|
|
|
|
netJP12L wrote: the very fast column
I you mean to the left of the last row, it indicates that the user can add rows.
You can disallow the addition of rows with AllowUserToAddRows = false
|
|
|
|
|
I am using the AddInParameter to add a Int32 value as a SQL paramter. The problem I am having is that it is possible for this value to be null. When I try using logic to return either the int value or a DBNull value as the parameter, because the parameter type is DbType.Int32 I get a build error. How can I, based on the value of the insert integer, either add the actual int value or a DBNull value in the AddInParameter method?
Thanks,
Steve
|
|
|
|
|
Not sure what you're saying; can you post the code and exception?
|
|
|
|
|
After doing further research I was able to get it working. The working code is as follows:
if (predicateTable["CollectionNumber"].ToString() != "0")
db.AddInParameter(cmd, "pCollection_Number", DbType.Int32, Convert.ToInt32(predicateTable["CollectionNumber"]));
else
db.AddInParameter(cmd, "pCollection_Number", DbType.Int32, DBNull.Value);
Thanks,
Steve
|
|
|
|
|
It occurs to me that for a library that supports .net 2 to include support for Extension Methods when compiled with later versions, I should use something like:
public static SomeType
SomeMethod
(
# if SomeConstant
this
# endif
SomeType Param
)
{
...
}
But is there a built-in constant to do that? I could easily define one myself, but it wouldn't be standard.
For command-line builds I can easily add a define to C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.rsp,
but that doesn't help with Visual Studio builds. I can add the define to the project properties, but I'd have to add it to each project that might contain Extension Methods, and remove it if I have to switch the target framework back to 2 (for whatever reason).
Does anyone else have a way of dealing with this issue?
Is there simply a better/more-standard way of doing this already?
|
|
|
|
|
Unfortunately there really aren't any built in conditional symbols like you are looking for. The best/only option is to define a symbol yourself.
If you are compiling using VS2008 and the multi-framework targeting features, check out this blog post[^] by Daniel Moth. He shows how to get extension methods to work in .NET 2.0. You would still need to define your own symbol, but you would only need to have it in one place (around the .NET 2.0 extension attribute class).
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Well, I knew about the Attribute, and I really wish they had simply allowed the use of it to decorate methods directly rather than mangling the language, but they didn't ask me. And there are other things I don't like about Extension Methods, but that's just me.
Anyway, I copied his Attribute to my library, and it compiled in VS 2008!
At the command-line, using the V3.5 CSC.EXE, I got
warning CS1685: The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Projects\PIEBALD\Attributes\ExtensionAttribute.cs'
as expected.
But the V2.0 CSC.EXE doesn't like the this syntax, likewise as expected.
So that's no solution.
|
|
|
|
|
Right, the .NET 2.0 compiler won't like the syntax. You will need to use the .NET 3.5 compiler but target the projects to the 2.0 Framework.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Scott Dorman wrote: .NET 3.5 compiler
I think I'd call that the C# 3.0 compiler.
|
|
|
|
|
PIEBALDconsult wrote: I think I'd call that the C# 3.0 compiler.
Yes...I was thinking about MSBuild, which in .NET 3.5 is marked as version 3.5. It's still the C# 3.0 compiler. Aren't these version numbers great?
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
How about running the C# file through the C++ preprocessor before build?
Somewhere in the SVN of xacc.ide I have a wrapper for 'cl -E' to process C# files (takes care of #regions). Maybe that will be of help.
I see no reason why you should not use the C# 3.0 compiler to target .NET 2, however
|
|
|
|
|
leppie wrote: through the C++ preprocessor
I already do that, at least for command-line builds, but only to prove that I can.
"C:\Program files\mingw\bin\cpp" -include "C:\Projects\PIEBALD\Defines.hs" -P -C -w %1.cs %1.csi
csc.exe @"C:\batfiles\Build.rsp" %1.csi
(Some details removed.)
And, yeah, it won't work if the file contains directives it doesn't understand.
However, this is based on how I dealt with directives when pre-processing embedded Oracle and RDB in C.
leppie wrote: I see no reason
I'm thinking of people who are stuck with VS2005.
Oh, and I did finally read up on xacc.ide and downloaded it, but that's as far as I've gotten so far.
|
|
|
|
|
Oh, and it's not entirely for how I build, but if/when I write a method to post here I may choose to write it as an Extension Method for the users who use them, but not have it break for the users who are using .net 2.
If I can, I should; if I can't, then I'll leave it out.
|
|
|
|
|
Ahh...that makes sense I suppose. I don't think I would worry too much about it, personally, but that's just me.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Running Vista (without SP1)
Working in VS2005
I am streaming a large file (a 900mb FLV movie) over localhost, but just past the halfway, the program throws this exception:
The specified network name is no longer available at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
We've tried the program on 5 machines (both XP and Vista), and it works on everybody's but mine.
Does anyone know why and/or have a solution?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am not sure but, when you open any webpages on local machine, at first time windows will ask you to "Enable Intranet Settings" for better performance on information bar. check that settings. may be its blocking larg file streaming.
|
|
|
|
|
I'm not using IE as my default browser.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|