473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Unable to enumarete the process module

I have a code like this and when i execute my program im taking this
error

unable to enumarate the process module
and here is my code

[code:1:628af64716]
public bool proccescheck()
{
int count=0;

MyCmd = new OdbcCommand();
MyConn = new OdbcConnection("DRIVER={MySQL ODBC
3.51 Driver};" + "SERVER=localhost;" +
"DATABASE=connector;" + "UID=root;" +
"PWD=root;");
MyConn.Open();
MyCmd.Connection = MyConn;
StringBuilder procheckbuild = new StringBuilder();
procheckbuild.Append("select name,memory from
programlar");
MyCmd.CommandText = procheckbuild.ToString();
OdbcDataReader procheck =
MyCmd.ExecuteReader(CommandBehavior.CloseConnectio n);

while(procheck.Read())
{
count++;
}
procheck.Close();
Process[] myproc = Process.GetProcesses();
for (int i = 0; i < myproc.Length-4; i++)
{
String procname = myproc[i].ProcessName;
String dir =
myproc[i].MainModule.FileName.ToString();
if (dir[0] == 'C' || dir[0] == 'D'
|| dir[0] == 'E' || dir[0] == 'F' || dir[0] ==
'G' || dir[0] == 'H')
{
myinfo =
FileVersionInfo.GetVersionInfo(dir);
}
for (int j = 1; j <= count; j++)
{
MyCmd = new OdbcCommand();
MyConn = new
OdbcConnection("DRIVER={MySQL ODBC 3.51
Driver};" + "SERVER=localhost;" +
"DATABASE=connector;" + "UID=root;" +
"PWD=root;");
MyConn.Open();
MyCmd.Connection = MyConn;
StringBuilder proceskontrol = new
StringBuilder();
proceskontrol.Append("select name,memory
FROM programlar where id ='");
proceskontrol.Append(j);
proceskontrol.Append("'");
MyCmd.CommandText =
proceskontrol.ToString();
OdbcDataReader prochecking =
MyCmd.ExecuteReader(CommandBehavior.CloseConnectio n);
while (prochecking.Read())
{
String program =
prochecking.GetString(0);
String memorysize =
prochecking.GetString(1);
int memory = int.Parse(memorysize);
if (myinfo.OriginalFilename != null)
{
if
(myinfo.OriginalFilename.Equals(program) ||
myproc[i].PrivateMemorySize64 == memory)
{
return false;
}
}
}
MyConn.Close();
}
}
return true;
}
[/code:1:628af64716]

how can i fix it ?
Thanks
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
0 1380

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Titus Cheung | last post by:
Hello, Just installed Apache and PHP. Edited the .conf file for the appropariate addtype lines, and Apache itself is working. However, when I type in the URL for the test script, the browser...
1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
1
by: shade1383 | last post by:
I have a web service that runs fine on my local machine and works fine with a VB .Net project remotely, but when I try to run using Access 2002 I get the following error. Server was unable to...
0
by: bazzer | last post by:
hey, i am using visual basic.net 2003 and have an ASP.NET webform application thats accessing a microsoft access 2003 database. i kept getting the following error when i tried to run it: ERROR ...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
3
by: Mac Campbell | last post by:
For some unknown reason my mdb seemed to drop a module I had named "Utilities". I tried to copy the module back in from a backup copy and got the error message "<<MyProject>> is currently unable to...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
3
by: =?Utf-8?B?TGV3aXMgTW90ZW4=?= | last post by:
Hello. We are having a problem here trying to compile C# applications. Only one developer has a problem where they attempt to compile the application and the compiler complains about being out of...
3
by: Tim Chase | last post by:
Not sure what's going on here and hoping for some insight: tim@rubbish:~$ echo $COLUMNS 129 tim@rubbish:~$ python2.5 Python 2.5.2 (r252:60911, May 28 2008, 08:35:32) on linux2 Type "help",...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.