|
S. Senthil Kumar wrote:
IIRC, the underlying connection is not closed and the managed SqlConnection
Maybe it's because my profiler (devPartner Studio) doesn't allow me to see it, but this space only shows up as "Unreachable Objects"; it doesn't show me the type of object. I would have expected to see a pooled connection with some type of indicative name, not Unreachable Objects.
This brings up the question though of where a pooled connection is kept. Seems I can utilize the same pooled connection from two different applications (right?), I would have expected it to not be included in the memory of my application space, but instead somewhere else. Maybe I need to study this more thoroughly.
S. Senthil Kumar wrote:
How did you measure? Task Manager?
DevPartner tells me how much memory it is profiling. I've verified this number with the .NET counters and it seems to be reliable.
Thanks for your help, Jason.
|
|
|
|
|
Jason Pease wrote:
Seems I can utilize the same pooled connection from two different applications (right?)
Really? I may be wrong, but I don't think that's possible. At best, they might be shared across all AppDomains in the same CLR instance.
This[^] is a very good (and free) profiler that shows the actual objects in the GC heap.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
how do I copy directories?
There is the Directory class, but it has no Copy method in it, and the File.Copy method won't let me specify a directory in its parameters.
|
|
|
|
|
you have to make your own function for it .you can travel a directory in breadth first search manner and then u can copy each file individually.In C# there is nothing for copying directories may be u can find anything in win32 api.although i am not sure.
|
|
|
|
|
Hi All,
I want to watch all fixed drives on a computer.Is there any reliable way to do that.I am watching for create , delete , change , rename events for all files and folders.I am using filesystemwatcher but its not very reliable at all especially for high trafiic activity.I am using empty string for the filter property.I have changed internalbuffersize to 32 KB.I don't want to miss any event , if any event fires two or three times that is not a problem.I in the notifyfilters i have set that property to NotifyFilters.Size|NotifyFilters.LastAccess|NotifyFilters.LastWrite|NotifyFilters.FileName|NotifyFilters.DirectoryName|NotifyFilters.CreationTime|NotifyFilters.Attributes even after that i am having troubles with word documents especially when i write into a word document and save it sometimes it fires changed event and sometimes i am not able to get the event .it is not showing the internal buferoverflow exception on that time either.and when i am copying a large directory say having around 13000 files then internal buffer overflow exception occurs.on msdn site they have given that with a 4 KB buffer size we can watch change for around 80 files so may be i have to use very large buffer size.Is there any other Class or Win32 API available which can do the task so that I must be able to watch all the events and don't miss any event.Thanks in Advance.
|
|
|
|
|
Without writing your monitoring code as an NTFS extension, no there is no reliable method to capture changes acrossed an entire volume. FileMon, from SysInternals, uses this technique. It requires a black belt in NTFS internals and Interop to implement though.
The FileSystemWatcher relys on the NT Kernel function ReadDirectoryChangesW . This function is known to have more than a few problems, especially when monitoring remote directories. The problems just get worse, the bigger the directory tree you're monitoring.
For more information, search for ReadDirectoryChangesW on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I know vertical length and horizontal length and sweep angle.
I am calculating the third side which is my chord length and also
calculating radius and height. but i am not able to set rectanlge points.
assuming x= 100 y = 250
Can any one help me.
Regards, Eswari
-- modified at 3:10 Monday 12th September, 2005
|
|
|
|
|
Hi,
I developed an application to read mails from a POP-3 Server.
But i want to know the arrival of new unread messages...
How can we know the status of an mail wheather it is read or unread..
Looking Forward for ur help
Thanx in Advance,
Bobby
|
|
|
|
|
POP3 doesn't have the notion of read/unread mails, I guess you have to implement logic in your client to do that. Depending on your design, you might want it to be stored as part of the mail itself, or as a separate metadata entity that refers to the mail.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi
I have done a program using thread(multithreading)
with 3 text boxes, 3 labels and a button. such that when the button is clicked,
Label 1 should become green color after the entered time period in text box1.
Label 2 should become Yellow color after the entered time period in text box2.
Label 3 should become Blue color after the entered time period in text box3.
This I have done with three threads to start these processes. that is start the three threads in the buttonclick.
Here is the coding part
sing System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
namespace multithreadtest
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Button button1;
private Thread t1, t2, t3;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
t1 = new Thread(new ThreadStart(colourlabel1));
t2 = new Thread(new ThreadStart(colourlabel2));
t3 = new Thread(new ThreadStart(colourlabel3));
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.label1.Location = new System.Drawing.Point(88, 64);
this.label1.Name = "label1";
this.label1.TabIndex = 0;
this.label1.Text = "Blue";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label2.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.label2.Location = new System.Drawing.Point(208, 64);
this.label2.Name = "label2";
this.label2.TabIndex = 1;
this.label2.Text = "Green";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.label3.Location = new System.Drawing.Point(320, 64);
this.label3.Name = "label3";
this.label3.TabIndex = 2;
this.label3.Text = "Red";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(96, 24);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 3;
this.textBox1.Text = "";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(208, 24);
this.textBox2.Name = "textBox2";
this.textBox2.TabIndex = 4;
this.textBox2.Text = "";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(320, 24);
this.textBox3.Name = "textBox3";
this.textBox3.TabIndex = 5;
this.textBox3.Text = "";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.button1.Location = new System.Drawing.Point(456, 40);
this.button1.Name = "button1";
this.button1.TabIndex = 6;
this.button1.Text = "Iterate";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(680, 397);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void colourlabel1()
{
Thread.Sleep(System.Convert.ToInt32(textBox1.Text));
label1.BackColor=Color.Blue ;
}
private void colourlabel2()
{
Thread.Sleep(System.Convert.ToInt32(textBox2.Text));
label2.BackColor=Color.Green ;
}
private void colourlabel3()
{
Thread.Sleep(System.Convert.ToInt32(textBox3.Text));
label3.BackColor=Color.Red ;
}
private void button1_Click(object sender, System.EventArgs e)
{
this.button1.Enabled = false;
t1.Start();
t2.Start();
t3.Start();
}
}
}
Now I am learning system.Threading.timer class, I couldnt understand how to work with this. Can anyone please explain me how to work withthis class and can anyone add this class to the above progarm and explain me..
dhol
|
|
|
|
|
there is a good threading example on msdn
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemthreadingtimerclasstopic.asp
hth
g00fy
|
|
|
|
|
First off, it isn't right to update UI controls from a different thread. This[^] might help you understand why.
To answer your question, simply drag and drop a timer from the toolbox. Set its interval property, subscribe to its Elapsed event and you should be done.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi
In c# windows form application, can u do a small program and make me understand this concept.
I find it difficult while coming across this topic(system.threading.timer).
Its really confusing me.
so please with a small example can u sent the coding part and explain wht it does.
pls do this help..
dhol
|
|
|
|
|
hi there!
is there a way in a scrollable control to trap dockpadding changes?
like an event or a virtual method that i can override?
tnx in advance!
|
|
|
|
|
|
|
thanks!
just another thing, how about during design time?
because it's only triggered when you changed the value & reload the form...
is there a way that it's automatically triggered when you change the value even without reloading the form?
thanks again!
microsoc
-- modified at 3:45 Monday 12th September, 2005
|
|
|
|
|
I have a c# windows applicaton that contains tab pages and panels. I want to resize them during the run time.
Is there any easy way to do that. I tried to find a inbuild property, but i couldn't find. Please Help...
Thanks & Regards!
|
|
|
|
|
Have you tried the properties Dock and/or Anchor for the panes/tabs?
cheers,
[r a w]
I do not understand what I do. For what I want to do I do not do, but what I hate I do. - Romans 7:15
|
|
|
|
|
Thanks Rahul.
I will check it.
Cheers,
|
|
|
|
|
Hi
I have 4 fields as my pk in access db.. I query for data in VS.NET 2003. I query by id AND pwd.. I can view the data in datagrid, but not update properly.
When i update it says:
The changes you requested to the table were not successful because they would create duplicate values in the index, pk, or relationship. Change the data in the field or fields that contain duplicated data, remove the index, or redefine the index to permit duplicate entries and try again.
I tried to solve the problem by going to access db and changed the 'Indexed' properties (of the 4 fields i used as my pk) from 'No' to 'Yes (Duplicates OK)'. but still i get the same error when i edit values in datagrid and click on update.
Something puzzling is, when i click on view button after i update, i can see the latest AND first updated entry in my datagrid and access db. The previously edited data is changed back to the original value again.
so what im saying is,
eg. row1) 4
row2) 4
row3) 4
I changed row2) from 4 to 5 and press update. the error msg is shown. then, i press View button. i see:
row1) 4
row2) 5
row3) 4
Now i change row3) from 4 to 3. again, error is shown. now i see:
row1) 4
row2) 4
row3) 3
I tried playing with it, i update both row1) and row2) at the same time. I changed row1) to 5 and row2) to 6 and i see:
row1) 5
row2) 4
row3) 4
What's happening and what must i do exactly?? Please help asap. Thank you!
|
|
|
|
|
nidhelp wrote:
I tried to solve the problem by going to access db and changed the 'Indexed' properties (of the 4 fields i used as my pk) from 'No' to 'Yes (Duplicates OK)'. but still i get the same error when i edit values in datagrid and click on update.
You should fix your code, not hack your database. You're trying to change an index to be a value that already exists. You should not change index values at all, that is what they are for.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ok... so do u mean i should change 'Indexed' back to 'No' for all of the 4 fields?
please pardon me, but where and how do i change my codes?
here's how i got my data to show in datagrid: i used the VS.net dataform wizard to generate dataadapter and dataset... then i go to configure dataadapter and add in the Where clause... i mananged to query by id and pwd, but cant update properly... i already generated all the commands successfully using oledbadapter...
i donno where's wrong and what to change...
please help me... it's urgent...
thankful for your advice!
|
|
|
|
|
nidhelp wrote:
ok... so do u mean i should change 'Indexed' back to 'No' for all of the 4 fields?
No, I mean if you create an index column, then it should be an identity, set by the database, not by you. And you should never change it.
Personally, I think the wizards for generating dataadapters are crap, you should just write your own SQL code in a database layer in your app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
A program I am writing uses a TabControl. Tabs are added dynamically on program init. Everything has gone fine in the development for months, but all of a sudden the program would appear to not respond when I would select an existing tab. It appears as if the UI is locked up, but the program is not using any more CPU than normal.
I have also noticed that when I shutdown, I briefly see a window that says ".NET BroadcastEventWindow 1.5.00 . . " is not responding. The window is there for only a fraction of a second, and then closes. I believe that the two might be related.
I even reverted to older code versions from before the program started happening, and see the same problem.
My program uses threads and sockets, if that makes any difference.
Any ideas on what would cause this problem? I've spent ~50 hours trying to track it down, but to no avail.
-- modified at 22:21 Sunday 11th September, 2005
|
|
|
|
|