|
Hello All,
I have two tables First one has PK auto increment column and the second table Has FK I select the last inserted PK in the First table and insert it into the second table as FK. is there is any more professional way to do so or this is the correct way?
Sms
|
|
|
|
|
If you're using SQLServer you can get the value of @@identity. It's a sql server var that gives you the value of the last autoincrement assigned.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Hi
Should I write destructors for all the classes or do all classes have destructors by default(In built)
Regards,
Sivaprasad
|
|
|
|
|
No, I don't think so.
.Net Framework has its own Garbage Collection.
---------------------------------
Believe what you saw!
|
|
|
|
|
No Need
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
If .net frame work handles this...Y should I write destructors manually in some cases and
Regards,
Sivaprasad
|
|
|
|
|
|
And how does this answer his question?
|
|
|
|
|
.NET does not have the same concept of destructors as C++ does. The ~T syntax (for C#) you see (where T is the name of the class) is actually a finalizer. You should almost never need to write a finalizer.
What you are probably thinking of is a Dispose method or the IDisposable interface. Really the only time you need to use this in your own class is when you are managing native resources (unmanaged memory) yourself or you are internally managing a class that implements it.
There are a lot of references available, both here on CP and the web. You can check out this article[^] for more information.
|
|
|
|
|
hi
how to call base class constructor from derived class
how to do it?
not by instantiaze the base class object..
thanks in advance
|
|
|
|
|
To kalyan_2416,
Take a look at the following sample.
public abstract class BaseClass
{
public BaseClass()
{
Console.WriteLine("Invoke from base class.");
}
}
public class DerivedClass : BaseClass
{
public DerivedClass()
: base()
{
Console.WriteLine("Invoke from derived class.");
}
}
class Program
{
static void Main(string[] args)
{
new DerivedClass();
}
}
---------------------------output--------------------------
Invoke from base class.
Invoke from derived class.
---------------------------------
Believe what you saw!
|
|
|
|
|
I am new in c# programming,i want to improve my programming ability,how?
|
|
|
|
|
A says like this : Practice makes perfect.;P
---------------------------------
Believe what you saw!
|
|
|
|
|
You need to study and gain experience. Being the "top" in anything takes time and hard work.
|
|
|
|
|
Hello Dears
Subject: Want to Disappear Context menue strip
I made a window service controller which are in system tray (sqlservier controler in system tray) , right click on symbol of (Controller)
the context menue strip is appear.... and show some menue like show, Exit etc...
now the problem is that if i click any where in desktop it should disapear but in our case it is not....
Now i Want to Disappear Context menue strip when i click any where on desktop except Context menue strip.....
Sooperfellow
-- modified at 2:15 Wednesday 26th September, 2007
Afridi
-- modified at 2:17 Wednesday 26th September, 2007
|
|
|
|
|
As I know, a real application has the ability to let users to change certain settings and alter the way the application runs, which is regarded as user configuration. Some settings will take the effect immediately after you click 'OK' while the program is running, some may request you to restart the program
I am a complete novice for programming, though I have read so many text books about C#. All I know now is that like how to create classes, structures, define functions, callbacks, delegates, interfaces, declare variables and so forth.
I totally have no idea about how to design a real application from scratch although I was thrown in this situation that I have to. I have partially completed the flowchart but I still don't understand how to persist and implement user configurations to make the application interactive?
Thanks for anyone could give me some hints.
-- modified at 23:13 Tuesday 25th September, 2007
Someone was born greatness;
Someone achieved greatness;
Someone have the greatness thrust upon him;
|
|
|
|
|
As you mentioned, you're a newbie in C#, so I think the most important thing to you is not the application interative but how to create a real application.
You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
YouMiss wrote: but I still don't understand that how to persist and implement user configurations to make the application interactive?
Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
---------------------------------
Believe what you saw!
|
|
|
|
|
Dunbar C wrote: You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
Thanks very much for your suggestion. But, if I could choose to start from all the fundamentals I would REALLY not put myself into this situation .
Dunbar C wrote: Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
I did read about that the C# (or maybe the .NET framework) supports the *.resx file format which is to persist all the external resources used for an application. However, upon what I read I haven't figured out how to modify a resource file at real-time. And yes, the resource file is making use of the XML file. Is it what you were just trying to say?
Someone was born greatness;
Someone achieved greatness;
Someone let the greatness thrust upon him;
|
|
|
|
|
YouMiss wrote: I did read about that the C# (or maybe the .NET framework) supports the *.resx file format which is to persist all the external resources used for an application. However, upon what I read I haven't figured out how to modify a resource file at real-time. And yes, the resource file is making use of the XML file. Is it what you were just trying to say?
.resx file is mostly like a file stores base 64 string of images or the extra infos of design mode of a form, and as default it's build as "Embedded Resource" in VS2005 (see the properties of one form, there is a "Build Action" node at the properties window). If you want to read and write the use configuration, a good way is to use .xml file or .config file, the select the "Build Action" as "Content", and the property "Copy to Output Direactory" as "Copy if newer".
---------------------------------
Believe what you saw!
|
|
|
|
|
Take a look at the System.Configuration namespece (mostly within the System.Configuration.dll assembly) as this contains everything you need to read and write configuration settings for an application.
|
|
|
|
|
Thanks for all...
Someone was born greatness;
Someone achieved greatness;
Someone let the greatness thrust upon him;
|
|
|
|
|
I am interested in designing a custom Form skin. I have seen several articles in the Code Project concerning the use of the skin, but I haven't seen much concerning the tools and techniques to make a good skin. Thanks in advance for your help.
HossFly
|
|
|
|
|
Have you asked the article authors? Post them a message at the bottom of their article's forum and they might help you.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Hello
I have this error in my project
unable to copy file "obj\Debug\systeme gharzolhasane.exe" to "bin\Debug\systeme gharzolhasane.exe". The process cannot access the file 'bin\Debug\systeme gharzolhasane.exe' because it is being used by another process. systeme gharzolhasane
Please help me
Thanks a lot
Malkan
You are winif you want
You are win if you want
|
|
|
|
|
Use task manager to see if there is another copy of devenv running. Happens sometimes when exit from debugger is not clean.
|
|
|
|