|
Thanks for the advice in the naming schema...
As for the SP, when I was timing the differences I used the same SP executed one right after the other
------------------
I'm naked under my clothes...
|
|
|
|
|
Another quick performance tip (although it doesn't explain why it is slower the second time around)
Change your while loop to:
while(drd.Read())
{
Search.Rows.Add(new object[] {drd[0], drd[1], drd[2], drd[3]});
}
sbp.Text = string.Concat(Search.Rows.Count.ToString()," records found.")
Now you only generate your text once, which should speed things up. Also, I changes the stringA + stringB notation in to a string.Concat() method call which is a wee bit faster.
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
Hi All,
I have a DataAdapter that I create in a middle data tier. Now if I called that middle data tier class and it creates that DataAdapter that is global in that class does it persist through the life of the App?
Thanks,
JJ
|
|
|
|
|
It will persist for the life of the class. Perhaps you want to make it static ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
So I call the class in my other class to do a function call and once that
function call is done so is the life of the class, correct?
Use said to make it static in global in the class then it will persist for the life of the App. Is this usually done in Database design apps?
Thanks,
JJ
|
|
|
|
|
MrJJKoolJ wrote:
So I call the class in my other class to do a function call and once that
function call is done so is the life of the class, correct?
If the class instance is created with a call to 'new' inside that function, yes.
MrJJKoolJ wrote:
Use said to make it static in global in the class then it will persist for the life of the App.
If it's a static variable in any scope then there will only ever be one instance of the class. If it remains the same instance, I'm not sure. On second thoughts, it may not solve anything at all. What needs to happen is simply that the instance of the class is created when your app starts and to be in a scope where it's not destroyed. In a desktop app, that would be the point where the main constructor is called, in an ASP.NET app, application start would be the way to go.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have a relativly simple control used for a layout manager for a form, its hierarchy is similar to this:
Parent Form
WorkspaceManager : Component
WorkspaceManagerControl : Control
DockingWindow : Control
ContainerWindow : Control
If I inherit 'DockingWindow' from a panel it gives me design time support to put controls on it etc.. (or set the ScrollableControlDesigner as the designer attribute)
This is almost what I want. The problem is that the DockingWindow is infact the control which draws all the required title bar etc.. and the ContainerWindow is the control I want to be able to drop controls onto
The ContainerWindow is an internal member of DockingWindow and definitly gets created and sized within the docking window ( a quick look with Spy++ shows this ) If I inherit this from Panel or add the ScrollableControlDesigner property to it I do not get the design time to support to drop the controls onto?
Why? Im probably missing some sort of attribute, or maybe need to expose the ContainerWindow as a property with some special attribute but I dont know what.
Any help/direction would be appreciated here.
Thanks - James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
Dirty Solution so far
WorkspaceManager as the DockingWindows exposed as a DockingWindowCollection
I also exposed a collection of ContainerWindows as a ContainerWindowCollection
You need to create a docking window, then create a container window in the workspace manager and set the ContainerWindow property on the DockingWindow to the ContainerWindow you want to use within the window.
This seems to work so far...
Any more encapsulated solutions would be welcome )
Thanks - James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
How to do synchronization to threads, for example if I have some number of nodes each have a thread and, also this nodes have some values for each node stored in an array, these values will be updated under some conditions “the one with min value will be updated first”, and the new value will be stored in the initial array.
How to do this?
nad
|
|
|
|
|
For information on thread synchronization, see the documentation for the System.Threading namespace in the .NET Framework SDK, specifically information about the Monitor (or use the lock keyword in C#) class which is the easiest to use (but not always appropriate). I also urge you to search this forum (use "Search Comments" above) and the CodeProject site for many examples and discussions. There have been several here in the C# forum similar to your problem in the recent past.
When using the lock keyword, the C# compiler generates the following:
lock(someObject)
{
Console.WriteLine("Hello, world!");
}
Monitor.Enter(someObject)
try
{
Console.WriteLine("Hello, world!");
}
finally
{
Monitor.Exit(someObject);
} someObject is an instance of an object and its scope depends on your requirements. Since you're synchronizing methods on different objects, you should use a static object like the Type of your class. So, if your class is called MyClass , then use lock(typeof(MyClass)) to make sure all threads are synchronized no matter which object is trying to access a resource (like your array). If you want to synchronize a resource that is specifically to a single instance of a class, then you can lock against this .
If you look at the namespace I mentioned before, there are many other synchronization objects that allow you to specify time-outs, share WaitHandle s, and more. There's also a topic in the .NET Framework SDK that should get you started: http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthreading.asp[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi!
I'm trying to have my videos of our software
(which is to be burned onto a dvd or cd)
protected from copying. I mean, I dont want the user
to copy-paste the lot of them with a happy smile.
I'd like them to be read-only.
Of course, it would be nice if there exist a simple solution
-aka not too expensive or even free!- to this minor problem.
What are my options ?
thanks !
This by our hands that dream,
"I shall find a way or make one!"
|
|
|
|
|
Your options are to use google and not to post in the C# programming forum. This is not a programming question. There are solutions available, but everything is crackable. Just go to http://slashdot.org[^] to see what everyone thinks of them and how fast they're cracked (think: DeCSS).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Just FYI...
Most CD copy protection schemes really just end up making some legitimate customers unhappy in the longrun (in other words, the protection causes some people who bought the software to not be able to run it).
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
hi
i am working on an applicatin that will record all keyboard keys in a text file.... just like the keylogger do.... i have worked in windows services ... i have make that ... but my application is not working like a keylogger .... don't take it in negitative sight.... just for learning porpose... thx..
Mazhar Hussain
|
|
|
|
|
|
yes this a question .... thx for your quick reply...thx
Mazhar Hussain
|
|
|
|
|
I have a TextBox inside a windows form (C#) which has capture property set to true. The TextBox captures the mouse events fine until I click inside the textbox itself, after which it does not respond to the mouse event happened outside its boundary. I checked the capture property and it is automatically set to false.
Thanks in advance
Manobal
|
|
|
|
|
Just out of curiosity, do you have a Click event handler for your TextBox.Click event? What is it doing? If so, you should put a breakpoint at the first statement of your handler and put a watch on the Capture property of your object and see when it changes. Examine the line before the change occured.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
No there is no click event declared for the textbox.
The TextBox is used to rename XYZ. So when a user choose to rename XYZ the textBox is enabled and user can write into it. Now If user is done renaming XYZ, he/she will click outside the boundary of textbox and I will disable the textbox. I am trying to make it similar the way it is done in windows to rename files.
The problem arises when I click inside the TextBox. It stops capturing the mouse events (Even though I set it to true) and I don't get mousedown event that occur outside textbox... I can not disable the textbox
Hope I made myself clear..
Thanks
MAnobal
|
|
|
|
|
It would be much simpler to handle the LostFocus or Validating event to disable the TextBox .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
Is there any one who can tell me how to get the port of an application with the application e.g i run an application and want to see on which port it is running by clicking the button with in that application
|
|
|
|
|
If your application binds to a port in order to listen, your application should already know which port and / or address it's binding to, or if you specify 0 for the port and IPAddress.Any for the address, you can retrieve the Socket.LocalEndPoint property to determine which address and port were selected by the service provider.
If you're connecting to another sock (and have not used Bind to pick a specific port), you should still be able to use Socket.LocalEndPoint to determine which address and port were used.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I need to copy files from a directory on our network out to a FrontPage Web's folder. Any tips/ideas on how to do this? The object browser is starting to give me a headache as I can't find anything to Open a web connection.
- Adam
|
|
|
|
|
This is a question better suited for the Web Development forum as it has nothing to do with C#. Please post in the appropriate forum next time, please.
You can, however, simply type a URL in the Open dialog box and a new web folder is usually created, but not necessary. FrontPage uses the FrontPage Server Extensions to connect to IIS (not simply WebDAV). You should also make sure that the FrontPage Server Extensions appropriate for your version of FrontPage are installed on the server with IIS installed.
If your FrontPage site is comprised of files from the network, use File->Publish and you're provided a number of options in which to publish the site to a FrontPage directory (see the paragraph above as it still applies) and most likely WebDAV and FTP depending on your version of FrontPage.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
I think my question was misunderstood. I am developing a C# application that will search a file system and then I want to automatically push the files found out to a web site that has FrontPage extensions installed. I know it is possible to connect to a site in this manner (Frontpage instead of FTP), I just don't know how. Can anyone help?
|
|
|
|