|
it means you are trying to call the function "process" which is only accessable if you create an instance of the object - prob Form1
Form1 form = new Form1();<br />
form.process();
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
How do I set an auto recovery for an Windows NT Service?
I want to restart the service automatically when it fails for some reason.
In Administrative Tools->Services-> select a service and see "Recovery" proterty tab.
There are ways to "restart the service" after failures.
How do I do it programatically?
Any Idea. A solution in C# or VB will be ideal, but C++ will also do.
I could n't find a way to do this.
Heelp !!!
Swarup Das
|
|
|
|
|
when i add a child form in an mdi form; and when i try to resize the mdi form scrollbars appears horizontally and vertically, i tried to vanish these autoscroll bars but i coudnt find the right property....
can anyone give me a suggestion?
|
|
|
|
|
[C# Windows Application]
When I make reportform that use .Net CrystalReport Component,
Should I do Create Designed DataSet(Support DataBase Schema) so that We use Drag-and-Drop Fields in Field Expoler?
What method do I make reportform use Drag-And-Drop in Field Expoler without creating Design Type DataSet?
|
|
|
|
|
Two questions.(dummy)
1. If there are number of namespaces included in a project, how to know which namespaces are used?
2. Is there any overhead if I referenced namespace and but not called any of the types included in that namespace?
Don't and drive.
|
|
|
|
|
Kant wrote:
1. If there are number of namespaces included in a project, how to know which namespaces are used?
If they're your namespaces that you created, pop open the object browser or Reflector[^]
If they're namespaces from the Framework, then you can look at the metadata in ILDASM or Reflector. To do it in Reflector, pop open the Assembly and click on the References item.
Kant wrote:
2. Is there any overhead if I referenced namespace and but not called any of the types included in that namespace?
IIRC, no. Because the Compiler optimizes away the unused namespaces. However, why reference a namespace that you aren't going to use?
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
David Stone wrote:
why reference a namespace that you aren't going to use?
Actually I need to change the code and the developer who wrote it, is gone. For a person like me whose experience is in C++/MFC, the C# code looks like greek to me.
Thx for the Reflector tip.
Don't and drive.
|
|
|
|
|
Namespaces are just ways of giving classes long names. So, when you write:
namespace utility
{
class Test
{
{
}
You're really just creating a class named utility.Test.
The unit of physical organization is the assembly, which sometimes map to specific namespaces, sometimes contain more than one namespace, and sometimes contain only part of a namespace.
The answer to #2 WRT assemblies is "no", there is no overhead if you reference an assembly but don't use anything from it.
|
|
|
|
|
Hello..
I used Crystal Report which was Visual Studio .net included.
And, I'd like to make some rpt file in Runtime, not Design Time.. you know!!
However, I don't know How to deal Crystal Report in Runtime..
Is there anybody to help me?
Thanks..
I'm not who I was
|
|
|
|
|
Hi all
how to change column's header text in datagrid ??
|
|
|
|
|
DataGrid1.Columns[0].HeaderText = "FirstName";
DataGrid1.Columns[1].HeaderText = "LastName";
Alexander German
|
|
|
|
|
sorry, forgot to add, that i am talking about windows.forms datagrid, not asp.net one
in winforms u dont have columns property,
header text is set via column styles, but dont know how to get them after setting styles
|
|
|
|
|
|
Thanks Kant.
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Hi. What's the difference between CInt(), Int32.Parse() and Convert.ToInt32() ? It looks to me that all of them are used to convert other data types to integer. So what's the difference?
|
|
|
|
|
CInt is a VB.NET thing...so I wouldn't touch that.
Convert.ToInt32() looks like this:
public static int ToInt32(double value) {
int local0;
double local1;
int local2;
double local3;
if (value >= 0) {
if (value >= 2.14748e+009)
goto i1;
local0 = (int) value;
local1 = value - (double) local0;
if (local1 > 0.5 || local1 == 0.5 && local0 & 1 != 0)
local0++;
return local0;
}
if (value >= -2.14748e+009) {
local2 = (int) value;
local3 = value - (double) local2;
if (local3 < -0.5 || local3 == -0.5 && local2 & 1 != 0)
local2 = local2 - 1;
return local2;
}
i1: throw new OverflowException(Environment.GetResourceString("Overflow_Int32"));
}
Int32.Parse() looks like this:
public static int Parse(string s) {
return Int32.Parse(s, 7, null);
}
public static int Parse(string s, NumberStyles style, IFormatProvider provider) {
NumberFormatInfo local0;
local0 = NumberFormatInfo.GetInstance(provider);
NumberFormatInfo.ValidateParseStyle(style);
return Number.ParseInt32(s, style, local0);
}
And Number.ParseInt32 is an extern method that calls into the CLR itself.
So, the Convert class does a lot of math checking and stuff like that. The Int32 implementation calls into the core of the CLR. So you may want to do some timer work to find out what is the fastest implementation.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Hey, .NET source code!
Where can I get it?
Thanks,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Alvaro Mendez wrote:
Where can I get it?
Check out :Anakrino[^], or you could always try to read ILDasm.exe output.
-Nick Parker
|
|
|
|
|
A waiter asks a patron, “May I take your order, sir?”
“Yes,” the man replies. “I’m just wondering, how exactly do you prepare your chickens?”
“Nothing special, sir. We just tell them straight out that they’re going to die.”
now for the serious stuff
Is it possible and where Do I look to be able to modify the .exe file as the program is running. Such as is it possible to add the date the program was first run, and then later to be able to check that date? or maybe keep a table of High Scores? Can you tell me where to go to find information on this sort of thing
Thanks for any info you can send my way.
Matthew
"When I was young we had a quicksand box - I was an only child, eventually" - Steven Wright
|
|
|
|
|
I don't think you can modify the executable.
You can, however, put all the data you want to store and recover into an object, and use serialization to save and load it.
|
|
|
|
|
I was wondering what is the best way to deal with database connections in c# windows application.
Is it good practice or not to pass a connection string through the application and open a connection object when you need to query the database or is it better to keep a database connection open throughout the application.
It is my understanding that it is better to open a connection when you need it.
Is there any security risks in accessing a connection string through a static property in my application or is there a better way of accessing the connection string throughout the application?
I would be interested to hear any-bodies suggestions.
Thanks
|
|
|
|
|
We use a configuration file for the connection information. The strings are encrypted for security. if there is a change, we can adjust the connection strings without compiling and deploying.
ed
Regulation is the substitution of error for chance.
|
|
|
|
|
The application uses the username and password that the user provides, not a default system account. Therefore it picks up the database security/permissions to tables/views etc.
Any thoughts about securing the connection string in this sort system.
Thanks
|
|
|
|
|
Build your connection string externally and use tokens for the username and password that can be replaced through code before they are used. I like to use [%USERNAME%] and [%PASSWORD%] as my tokens.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
At the moment I have a private member variable with I store the connection string in. I make this variable accessible through a public static property.
What are the benefits of using the token methods?
Is the static property a good or bad way to store the connection string.
Getting back to the orignal post what do people think good practice is for handling database connections?
|
|
|
|