|
Sonia Gupta wrote: what will happen if i declare the class as static?
Open www.google.com[^].
Type "C# static class".
Hit the "Google Search" button.
Click on first link.
Read second paragraph.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
In this case the result will be the same. Because when you declare a method static in a non-static class you can call it without creating new object. If you declare class static, you're declaring only static methods inside... For more search google...
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
I have to make a clarification in the following funciton.
public SqlParameter Parameter<T>(string parameterName, DbType parameterType, T value, ParameterDirection direction)
{
}
here in the funciton <T> is declared after the funciton name.
if in the funciton parameters , i declare string value inspite of T value.
will it produce any sort of less effeciency.
I mean What's the importance of this <T> in the funciton?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia - when I originally posted the snippet with the <T> parameter in, I explained to you that this was a generic. Please take a look at google and see what you can find out. When you've had a look, feel free to come back and ask questions, but this question is answered in the basics of using generics.
CodeProject is not a programming tutorial. It is not here to remove the need for you to buy a book or two. In little over 6 months, you've posted approximately 835 questions and follow up questions. Doesn't this tell you that you could get some help from other sources?
I would suspect that most people on the forums are like me, and buy books and use google a lot. These should be your first port of call EVERY TIME.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Sonia Gupta wrote: here in the funciton <t> is declared after the funciton name.
That's generics.
Sonia Gupta wrote: if in the funciton parameters , i declare string value inspite of T value.
will it produce any sort of less effeciency.
In this case, not really, as the value of an SqlParameter will be stored as an object anyway, but you may get type conversion problems if you for example try to store a date in a parameter, and the date format on the server is different from what the database expects.
Sonia Gupta wrote: I mean What's the importance of this <t> in the funciton?
Generics is used to create type specific code (which is more efficient than using dynamic types) without having to rewrite the code for every possible type you want to use.
A List<t> is for example used instead of ArrayList to produce type safe lists where you don't have to cast to and from Object when accessing the items.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Thanks......
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Hi, i am new to this language but loving it. Can someone please tell me how to
Add a chm file (This is my help file that i created) to my existing c#.net project. It is a windows application.
The help will be much appreciated
|
|
|
|
|
Drag a Help Provider control from the toolbox and assign the .chm filename to it in its properties...the .chm file will be invoked on pressing the F1 key
Koushik
|
|
|
|
|
Thanks for the reply, I tried but it does'nt display the file whem i press F1. On the properties window i specified the HelpNamespace, is this correct?
|
|
|
|
|
That's correct...set HelpNamespace="Your file location".
Also add the following code in your designer.cs under the helpprovider1 section
this.helpProvider1.SetShowHelp(this, true);
Koushik
|
|
|
|
|
I have a usercontrol,I program to move it flow my Mouse,
To do this,I must create a Point of usercontrol which equal with Point my mouse but when I move my mouse,I see my usercontrol is flicker(twinkel),pleasa,help me process it
|
|
|
|
|
You must have used some wrong code.
Create a MouseMove event and set the Location to the point of the mouse.
------------------------------------------------------------------
Life would have been much easier if I had the source-code!!
|
|
|
|
|
Coders,
Is there an application/sample source here in codeproject
that is the same in DTS (Data Transformation Service). It will copy database from source to destination.
Can you help me, a link or something.
Thanks in advance.;)
******************************
I just want to
know everything
|
|
|
|
|
Hi,
Kindly let me know that, who is powerfull between :
C++ 2005 and C# 2005.
Thank you in Advance
(Riaz)
|
|
|
|
|
The one that fits better your needs.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Depends on Requirement or Problem.
Best Regards,
Chetan Patel
|
|
|
|
|
hi all,
I have a listview where i am trying to display thumbnail images similar to windows explorer. i have set the owner draw property to true and i managed to display the thumbnails using the drawitem event.
But when i execute my application there seems to be a flickering in listing of images. i found many samples illustrating to set the doublebuffered property to true. and use setstyles property.
public mylistview()
{
//Activate double buffering
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
//Enable the OnNotifyMessage event so we get a chance to filter out
// Windows messages before they get to the form's WndProc
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
this.DoubleBuffered = true;
}
protected override void OnNotifyMessage(Message m)
{
//Filter out the WM_ERASEBKGND message
if (m.Msg != 0x14)
{
base.OnNotifyMessage(m);
}
}
but still the flickering occurs. i found a article Flickerfree listview
here^
but that does not seem to work perfectly.
Can anyone help me with some links or suggestions??
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Hi all
I have a doubt how to find a word exactly using regular expression.
Ex:-
While supplying some query "select * from tablename"
how to find "select" word alone using regular expression
kesavan
|
|
|
|
|
Why would you use a regular expression for that? A regular string operation is simpler and faster.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
No guffa
I have a situation to use regular expression
kesavan
|
|
|
|
|
NK7 wrote: I have a situation to use regular expression
That sentence doesn't really make sense, but I guess that you have some reason...
Just use the Regex.Escape method to turn a string into a regular expression pattern.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
\bselect\b
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
|
|
|
|
|
|
HI,
i like to if there is a way to change the CellBorder Color?
THNKS
Have Fun
Never forget it
|
|
|
|
|
Hi all....
how to copy a file from server to local disk using javascript....
is there any possible way like copy.file(path1,path2); in C#
i tried a lot but didnt get how to...
i'm writing an application in .net. but want to write some code in javascript.
|
|
|
|