15,891,253 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by pmcm (Top 52 by date)
pmcm
7-Dec-15 10:28am
View
My application target service is deployed across a mixture of 2008 and 2012 servers, and the version of Microsoft.Web.Administration.dll is different on both. I tried building my application with the MWA v8.5 DLL but when I deploy the code to the 2008 server the Service doesn't do anything. due to the MWA.dll version being different on a 2008 server.
At present our applications Service is using the DirectoryEntry class to try and manipulate IIS. Should I still be able to use the properties from this class to work with IIS 8/Server 2012 and stop/start app pools for example? Are there any known issues of using the DirectoryEntry class to stop/start app pools in IIS8/Server 2012?
pmcm
4-Dec-15 4:26am
View
I appreciate your reply. The Service runs under the Administrators group and I have tried adding it to the IIS_URSRS which is also in the Admin group.
pmcm
5-Sep-14 5:20am
View
i tried this but still the data in the cols is not spaced
pmcm
26-Aug-14 4:33am
View
I was just doing this and I think this may be the solution.
pmcm
3-Jul-14 10:05am
View
I read that on the website but didn't think it was applicable to a login request, especially as the APIKey is an output from this function
pmcm
3-Jul-14 9:42am
View
retried with this a valid url and I'm still getting the same error, anything else I can try? also if i'm just trying to test the login to this site do I need the to set postData?
pmcm
3-Jul-14 9:37am
View
retried with this a valid url and I'm still getting the same error, anything else I can try? also if i'm just trying to test the login to this site do I need the to set postData?
pmcm
3-Jul-14 9:26am
View
whats wrong with that url? the kanbanize site states that the login url should be in this format: http://kanbanize.com/index.php/api/kanbanize/login/email/test%40test.com/pass/test
Missed the special char conversion in the string - let me retry!
pmcm
4-Jun-14 7:34am
View
Can u suggest a workaround for me?
pmcm
4-Jun-14 6:56am
View
I was able to get this working in a test app that I developed, but when I copied the logic to my main application:
string serviceName = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\").GetSubKeyNames().Where(s => s.StartsWith(editedServiceName)).FirstOrDefault();
I'm getting this error: "Object reference not set to an instance of an object." The variable editedServiceName is valid and the registry exists (I checked it manually). This application is built using v2 of .Net Framework. Can you think of any other reason why this is failing over at this point?
pmcm
30-May-14 3:21am
View
The Transaction Was Aborted
Executing command "C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u /LogToConsole=true "D:\srvapps\MedBill\MedBill.exe"" (Timeout is set to 240000 ms):
2014-05-28 10:10:48 info [native] No Registry-Settings exist for this process
2014-05-28 10:10:48 info [native] Agent has no active settings - running normally
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.17929
Copyright (C) Microsoft Corporation. All rights reserved.
The uninstall is beginning.
See the contents of the log file for the D:\srvapps\MedBill\MedBill.exe assembly's progress.
The file is located at D:\srvapps\MedBill\MedBill.InstallLog.
Uninstalling assembly 'D:\srvapps\MedBill\MedBill.exe'.
Affected parameters are:
logtoconsole = true
logfile = D:\srvapps\MedBill\MedBill.InstallLog
assemblypath = D:\srvapps\MedBill\MedBill.exe
The file containing the saved state for the D:\srvapps\MedBill\MedBill.exe assembly, located at D:\srvapps\MedBill\MedBill.InstallState, could not be read, and the file might have been corrupted. The uninstall will continue without the saved information.
An exception occurred during the uninstallation of the EPSInstaller installer.
System.Configuration.Install.InstallException: Null savedState param. Possible cause: Missing or corrupt Installstate file.
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete.
The uninstall has completed.
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete.
Service MedBill found. Uninstall failed!
pmcm
26-Mar-14 11:43am
View
1. Missing a comma between each col header value?
3. So the app creates the file and then displays a message to the user asking do they want to open or save the file - similar to downloading a file online for example.
pmcm
13-Feb-14 9:05am
View
Thanks for responding, I was able to use the other method provided to help me instead.
pmcm
13-Feb-14 6:47am
View
Hi, I'm trying to implement your suggestion above but I am getting this error message:
"'System.Data.Objects.ObjectQuery<housemanager.contact>' does not contain a definition for 'Find' and no extension method 'Find' accepting a first argument of type 'System.Data.Objects.ObjectQuery<housemanager.contact>' could be found (are you missing a using directive or an assembly reference?)"
I've added: using System.Data.Entity;
What else am I missing?
pmcm
12-Feb-14 5:07am
View
Thanks for the book recommendation!
pmcm
11-Feb-14 11:38am
View
thanks for this, an update to your help:
var contact = (from cont in context.Contacts
where cont.ContactID = cboContactList.SelectedIndex
select cont).SingleOrDefault();
but this is giving me the error cannot implicity convert type 'int' to 'bool'. I've tried wrapping convert.toint32 around my oContactList.SelectedIndex.
pmcm
28-Jan-14 8:21am
View
When I do this it sets the display value of the Dropdownlist to "-- Please Select a Contact --" which is not what I want if I insert a new contact, i'd like that persons name to be the display value. How do i achieve this?
pmcm
28-Jan-14 6:48am
View
Here it is:
private void QueryContacts()
{
cboContactList.DataSource = context.Contacts.ToList();
cboContactList.DisplayMember = "FirstName";
cboContactList.ValueMember = "ContactID";
cboContactList.Text = "-- Please Select a Contact --";
cboContactList.Invalidate();
}
pmcm
17-Jan-14 5:42am
View
No it's not being called from the Main Form but the solution below allows me to catch the error without processing any extra unnecessary code once returned from this method:
ArrayList files = FileSearch(newPath, environment + "*");
if (files.Count == 0)
{
Log("No configs matching that environment prefix were found in the following path:" + Environment.NewLine + newPath);
return;
}
pmcm
17-Jan-14 4:54am
View
Yes I was aware of that, this application existed long before it became my responsibility. My aim at the minute is to make the message more user friendly before looking into updating the code that's there at present.
pmcm
17-Jan-14 4:36am
View
after no files are found in the directory, the code continues to process but I'd like to retun to the main form at this point with the message that there were no files found so the user can select a new version.
pmcm
19-Nov-13 7:20am
View
the aim is to make it easier to manage these items for future changes. Instead of having to update this class and release a new build having this data in an xml file or defined in the app.config would mean only 1 file has tp be updated. I'm not asking for you guys to do this for me but if you could point me in the correct direction with a tutorial or link I can try it and then ask for more help if required.
pmcm
7-Nov-13 11:15am
View
Ok I'm another step closer I think to resolving this, I've added a counter to the number of Transaction nodes returned and from here I would like to select the 2nd Error node but this updated linq query is not quite right:
<pre lang="c#">
int counter = 0;
// Query the Transaction element and write out a subset of Transaction
var query1 = from d in doc.Root.Descendants("Transaction")
select new
{
TransactionID = d.Element("TransactionID").Value,
TransactionDate = d.Element("TransactionDate").Value,
CompressedFileName = d.Element("CompressedFileName").Value,
TransactionSuccessFlag = d.Element("TransactionSuccessFlag").Value,
TransactionErrors = d.Element("TransactionErrors").Value
};
foreach (var details in query1)
{
Transaction = "Transaction Details:" + "\r\n" + Convert.ToString(details) + "\r\n";
counter++;
}
if (counter > 1)
{
// Query the data and write out a subset of Error
var query2 = from e in doc.Root.Descendants("Error")
where e.Element("ErrorMessage") != null
select new
{
TransactionID = (string)e.Element("TransactionID").Value,
ErrorMessage = (string)e.Element("ErrorMessage") ?? String.Empty,
InnerException = (string)e.Element("InnerException") ?? String.Empty,
StackTrace = (string)e.Element("StackTrace") ?? String.Empty,
Data = (string)e.Element("Data") ?? String.Empty,
};
foreach (var errors in query2)
{
Error = "Error Details:" + "\r\n" + Convert.ToString(errors);
}
}
</pre>
why am I not getting the 2nd Error node details whenever I'm doing my select on where e.Element("ErrorMessage") != null
pmcm
22-Oct-13 6:35am
View
Hi I got round the above error by doing this
private static string ParseXMLDS(string xmlDS)
{
try
{
var doc = XDocument.Load(xmlDS);
StringBuilder Transaction = new StringBuilder();
StringBuilder Data = new StringBuilder();
StringBuilder Errors = new StringBuilder();
// Query the Tansaction tags data and write out a subset of info
var Transquery = from b in doc.Root.Descendants("Transaction")
select b.Element("TransactionDate").Value + "/r/n" +
b.Element("CompressedFileName") + "/r/n" +
b.Element("TransactionSuccessFlag").Value + "/r/n" +
b.Element("TransactionErrors").Value;
foreach (string info in Transquery) Transaction.AppendLine(info);
//Query the Data tags and write out a list of decompressed files
var Dataquery = from c in doc.Root.Descendants("Data")
select c.Element("FileToCompress").Value +
c.Element("CompressedFileName").Value;
foreach (string name in Dataquery) Data.AppendLine(name);
// Query the Data tags and write out a list of decompressed files
var Errorsquery = from c in doc.Root.Descendants("Error")
select c.Element("transactionID").Value +
c.Element("ErrorMessage").Value +
c.Element("InnerException").Value +
c.Element("StackTrace").Value +
c.Element("Data").Value;
foreach (string error in Errorsquery) Errors.AppendLine(error);
return Data.ToString();
}
instead having 3 seperate Linq queries can I join the queries and return the seletected info?
pmcm
17-Oct-13 8:41am
View
Thank you for your help!
pmcm
17-Oct-13 6:58am
View
just tested this and I don't believe my code is creating an array based on content.Split(sep); because during debugging whenever I verify splitContent I have 1 string =
[0] = " Files : 1 1 0 0 0 0"
Any idea how I should best split this line to pull the 1st value after " Files :"??
pmcm
16-Oct-13 7:00am
View
I have been trying to do this method:
private bool ParseXMLDS(string xmlDS)
{
XmlDocument xmlDoc = new XmlDocument();
//xmlDoc.LoadXml(xmlDS);
xmlDoc.LoadXml(xmlDS.Substring(xmlDS.IndexOf(Environment.NewLine)));
string xpath = "NewDataSet/Data ";
var nodes = xmlDoc.SelectNodes(xpath);
StringBuilder compressedFile = new StringBuilder();
foreach (XmlNode childrenNode in nodes)
{
compressedFile.AppendLine(childrenNode.SelectSingleNode("//FileToCompress").Value);
}
if (m_Logger != null)
m_Logger(string.Format("File Decompression Successfully Completed." + '\n' + "{0}", compressedFile));
return true;
}
but I'm getting this error: {"StartIndex cannot be less than zero.\r\nParameter name: startIndex"}.
I'm actually converting a dataset into XML to do this parsing - is this the right thing to do?
pmcm
22-Jul-13 10:24am
View
i'm using this code to try to compare the values:
DataGridViewRowCollection coll = dgvDuplicates.Rows;
DataGridViewRowCollection colls = dgvDuplicates.Rows;
//List<string> listParts = new List<string>();
int count = 0;
foreach (DataGridViewRow item in coll)//379
{
foreach (DataGridViewRow items in colls)//143641
{
if ((items.Cells["ENVA_ENVIRONMENT_APP_ID"].Value != null))
{
if ((items.Cells["ENVA_APP_ID"].Value != null) && (items.Cells["ENVA_APP_ID"].Value.Equals(item.Cells["ENVA_APP_ID"].Value)))
{
item.DefaultCellStyle.BackColor = Color.Red;
item.DefaultCellStyle.ForeColor = Color.Black;
}
}
}
count++;
}
but instead of iterating through the result records to compare against, this is always comparing the 1st row against each of the subsequent rows which is not what I want. I'd like to compare Row2 against Row1, Row3 against Row2, Row4 against Row3 and so on. Can you see what I'm doing wrong?
pmcm
22-Jul-13 8:51am
View
can you point me in the right direction to another link or site (anything I have looked at so far has not help me yet)to compare the values of row. Do I need to do this comparison after binding the data to the DataGrid or would the RowsAdded Event be better?
pmcm
22-Jul-13 8:27am
View
not sure this is exactly what I am after. I'd like to compare a col in row 1 with the same col in row 2 and if the values match then highlight the rows
pmcm
10-May-13 9:49am
View
I appreciate your help, so far I've added this to FileSystemItemCS.cs:
public FileSystemItemCS(string FullPath, string extension, long size, DateTime LastWriteTime, bool IsFolder, string ImageUrl);
and in the gvFiles_RowDataBound method:
if (e.Row.RowType == DataControlRowType.DataRow)
{
FileSystemItemCS item = new FileSystemItemCS((e.Row["FullPath"]),(e.Row["extension"]),(e.Row["Size"]),(e.Row["LastWriteTime"]),(e.Row["IsFolder"]),(e.Row["ImageUrl"]));
//var item = e.Row.DataItem as FileSystemItemCS;
still getting this error message: Cannot apply indexing with [] to an expression of type 'System.Web.UI.WebControls.GridViewRow'
pmcm
10-May-13 9:40am
View
Also tried adding FileSystemItemCS item = new FileSystemItemCS(e.Row.DataItem["size"]). A folder or file is expected here new FileSystemItemCS(Directory/File)
and now getting this error: "Cannot apply indexing with [] to an expression of type 'object'"
Thanks
pmcm
10-May-13 9:34am
View
What additional constructor is required to FileSystemItemCS?
pmcm
25-Apr-13 5:35am
View
I think I am going to go down the route of developing an expandable datagrid so I can make use of the multiple columns whilst still keeping the right sided pane for previewing the contents
pmcm
25-Apr-13 4:05am
View
Have you an example of how this is implemented?
pmcm
21-Mar-13 10:01am
View
this is an option I have been looking at only using sitemap.xml instead of a DB
pmcm
21-Mar-13 9:59am
View
whilst your solution would work for dynamically add items to the Menu it does not allow the user to specify the Text & Value. I know allowing the user to specify these values is a security risk so I will have to investigate this requirement further.
pmcm
14-Sep-12 5:16am
View
I've also tried using a MS Word 97-2003 document file as the template but I am still getting the same error. This file was created by saving the template file with .doc instead of .dot
pmcm
14-Sep-12 5:12am
View
the file is saved as a MS Word 97-2003 template
pmcm
12-Sep-12 7:56am
View
thank you for your help
pmcm
22-Aug-12 10:57am
View
No I am initially populating my DDL control on the page load, should I be repopulating it upon postback?
pmcm
17-Jul-12 6:27am
View
can you show me the syntax to perform this?
Plus if I'm already doing a select * from my file to fill a datatable can I not just select the values from the datatable?
pmcm
19-Jun-12 10:08am
View
I've found this on another website - looks like 3.5 uses the 2.0 App Pools: ".NET 3.5 still runs on the 2.0 CLR. The framework versions 3.0 and 3.5 only added to the Base Class Library and added additional frameworks. 3.0 added WCF, WPF, and Workflow. It also contained a lot of the base framework additions for Linq which was added in 3.5. These still run on the 2.0 CLR. Framework version 4.0 also came with an upgrade to the CLR."
pmcm
19-Jun-12 9:18am
View
I'm trying to do this on my local machine first of all, and yes you are correct I only have Application Pools for 2.0 and 4.0 .NET Framework. If I download .NET FW 3.5 onto my machine will this cause any problems as I already have .NET FW 4.0?
pmcm
19-Jun-12 9:18am
View
I have tried this step already and it never helped
pmcm
4-May-12 8:38am
View
hi i added your code and tried to run it but got a runtime error:
"System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object." On the following line
<pre>if (currentRow[i] != DBNull.Value && previousRow[i] != DBNull.Value && !currentRow[i].ToString().Equals(previousRow[i].ToString()))</pre> i'm guessing this is because the previous row is the header detail. Any idea how I solve this?
Thanks for your help
pmcm
12-Mar-12 11:46am
View
I have tried what you suggested but I am still getting the same problem.
<!--Errors Found During Generation: warning 6002: The table/view CompanySecretarial_Datawarehouse.dbo.vw_CompanyExecutives' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.-->
<entitytype name="vw_CompanyExecutives">
<key>
<PropertyRef Name="CompanyExecutiveID" />
<Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="255" />
<Property Name="ExecutiveName" Type="nvarchar" Nullable="false" MaxLength="255" />
<Property Name="ExecutiveType" Type="int" Nullable="false" />
<Property Name="DateAppointment" Type="datetime" />
<Property Name="DateResignation" Type="datetime" />
<Property Name="CompanyID" Type="int" Nullable="false" />
<Property Name="ExecutiveID" Type="int" Nullable="false" />
<Property Name="CompanyExecutiveID" Type="int" Nullable="false" />
and the same in the CSDL Content Section
<entitytype name="vw_CompanyExecutives">
<key>
<PropertyRef Name="CompanyExecutiveID" />
<Property Type="String" Name="CompanyName" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Type="String" Name="ExecutiveName" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Type="Int32" Name="ExecutiveType" Nullable="false" />
<Property Type="DateTime" Name="DateAppointment" />
<Property Type="DateTime" Name="DateResignation" />
<navigationproperty name="Executives" relationship="CompanySecretarialDatawarehouse.vw_CompanyExecutivesExecutives" fromrole="vw_CompanyExecutives" torole="Executives">
<Property Type="Int32" Name="CompanyID" Nullable="false" />
<Property Type="Int32" Name="ExecutiveID" Nullable="false" />
<navigationproperty name="Company" relationship="CompanySecretarialDatawarehouse.Companiesvw_CompanyExecutives" fromrole="vw_CompanyExecutives" torole="Companies">
<Property Type="Int32" Name="CompanyExecutiveID" Nullable="false" />
pmcm
12-Mar-12 11:24am
View
DO i remove this StoreGeneratedPattern="Identity" from all of my entities? The enitiy I'm having trouble updating is from a view and the XML is this:
<entitytype name="tbl_CompanyExecutives">
<key>
<PropertyRef Name="CompanyID" />
<PropertyRef Name="ExecutiveID" />
<PropertyRef Name="ExecutiveType" />
<Property Name="CompanyID" Type="int" Nullable="false" />
<Property Name="ExecutiveID" Type="int" Nullable="false" />
<Property Name="ExecutiveType" Type="int" Nullable="false" />
<Property Name="DateAppointment" Type="datetime" />
<Property Name="DateResignation" Type="datetime" />
pmcm
9-Mar-12 8:17am
View
the DGV is bound to the following:
<pre lang="c#">
public ObjectResult GetCompanyExecutivesList()
{
// Check we have an ObjectContext
if (entities == null) entities = new CompanySecretaryEntities();
//define the query
var query = from ce in entities.CompanyExecutives
join exec in entities.Executives on ce.ExecutiveID equals exec.ExecutiveID
join companies in entities.Companies on ce.CompanyID equals companies.CompanyID
select new
{
CompanyName = companies.CompanyName,
ExecutiveName = exec.ExecutiveName,
//Executive = ce.Executive,
DateAppointment = ce.DateAppointment,
DateResignation = ce.DateResignation
};
// Create a query from the entityset
ObjectQuery companyexecutives = (ObjectQuery)query;
// Return the results
return companyexecutives.Execute(MergeOption.AppendOnly);
}</pre>
My grid has 5 cols and I've set the dataproperty of the each to CompantName,ExecutiveName, DateAppointment, DateResignation but for Executive I want to have a combobox list of Yes/No and if yes is selected I want to update my EDM with 1 else 2 for No.
pmcm
9-Mar-12 5:11am
View
my method now looks like this:
<pre lang="c#">
public ObjectResult<CompanyExecutives> GetCompanyExecutivesList()
{
// Check we have an ObjectContext
if (entities == null) entities = new CompanySecretaryEntities();
//define the query
var query = from ce in entities.CompanyExecutives
join exec in entities.Executives on ce.ExecutiveID equals exec.ExecutiveID
join companies in entities.Companies on ce.CompanyID equals companies.CompanyID
select new
{
CompanyName = companies.CompanyName,
ExecutiveName = exec.ExecutiveName,
ExecutiveType = ce.ExecutiveType,
DateAppointment = ce.DateAppointment,
DateResignation = ce.DateResignation
};
// Create a query from the entityset
ObjectQuery<CompanyExecutives> companyexecutives = (ObjectQuery<CompanyExecutives>)query;
// Return the results
return companyexecutives.Execute(MergeOption.AppendOnly);
}</pre>
pmcm
9-Mar-12 5:08am
View
I copied your suggestion into my code but got this error:
"{System.InvalidCastException: Unable to cast object of type 'System.Data.Objects.ObjectQuery`1[<>f__AnonymousType1`5[System.String,System.String,System.Int32,System.Nullable`1[System.DateTime],System.Nullable`1[System.DateTime]]]' to type 'System.Data.Objects.ObjectQuery`1[CompanySecretary.CompanyExecutives]'.
at DAL.DataAccessLayer.GetCompanyExecutivesList()"
pmcm
5-Mar-12 4:41am
View
"dal.GetPresentersList()" was returning a List object but I've amended that to now be this:
<pre lang="c#">
public ObjectResult<Presenters> GetPresentersList()
{
// Check we have an ObjectContext
if (entities == null) entities = new CompanySecretaryEntities();
// Create a query from the entityset
var query = from p in entities.Presenters
select p;
ObjectQuery<Presenters> presenters = (ObjectQuery<Presenters>)query;
return presenters.Execute(MergeOption.AppendOnly);
}</pre>
Show More