.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

objWMIService.Create throws type mismatch error

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :.NET Framework

I am trying to interface with AD. i can gather information but when I get an error when I try to run a remote process.

mySWbemLocator = CreateObject("WbemScripting.SWbemLocator")
            objWMI = mySWbemLocator.ConnectServer(ServerName, "\root\CIMV2:Win_Process", "myUserName", "myPassword")

            objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!" & _
                            "\\" & ServerName & _

Dim command As String = ProgramName & " " & sCommandLine

result = objWMIService.Create(command, vbNull, vbNull, process)


when i run it it comes back as "type mismatch" and pointing to process. I have done some research but i am not sure what is causing the problem. I have tried to dim process as integer, long, and uint32 but nothing seems to work.

View Complete Post

More Related Resource Links

Grand Totals showing "Type MisMatch" error

Hi All, I have created a calculated measure using Exponential and Datediff function, and the formula is shown below. ( (EXP((DateDiff( "d", CDATE([Time].[Date].CurrentMember.PrevMember.MemberValue), CDATE([Time].[Date]. CurrentMember.MemberValue)))/365.0 * [Measures].[CD Dec Interest Rate]) -1) * ([Time].[Date]. CurrentMember.PrevMember.PrevMember,[Measures].[Cummulative_Premium])   ) In the above formula what i am trying to achieve is finding the difference between previous date and current no of days in days and dividing it by 365 and doing some multiplication after that, When i deployed above formula all my row values are getting displayed correctly but all my grand totals are displaying as "#VALUE" and when i checked the error, it displays as TYPE MisMatch. Could some one help me in finding the problem in above formula. Thanks in advance.

Parser Error Message: Could not create type 'Service'.


My web service works fine on my local machine but when i put it on the server it throw this error:

Parser Error Message: Could not create type 'Service'.

I don't know how to fix this.

Workflow Constructor Error: Could not create activity of type '{Workflow}'

If I attempt to new-up a custom class in my Workflow constructor:

_workflowInfo =  
                new WorkflowInfo(workflowProperties.OriginatorUser, workflowProperties.Item,  

... I receive the following error:

Error 1 Could not create activity of type '{Workflow}'. System.ArgumentNullException: Value cannot be null.
Parameter name: uriString
   at System.Uri..ctor(String uriString)
   at Microsoft.Shar

"Cannot create unknown type" error when invoking a dynamic activity

I am trying to use WF 4 to create business rule policy activities that I can store as XAML files and execute dynamically so the rules can be changed without recompiling.  I have created an ExecuteActivityFromXAML activity that takes the path to the XAML file and a dictionary of inputs and loads a dynamic activity from the XAML and then uses workflow invoker to invoke the activity passing in the input parameter dictionary.  In another assembly, I have created rule executor activites that wrap each of the xaml rule activities and build the input parameter dictionary and specify the XAML file path.  For example, I have a parent-child object with three rule activities stored as xaml files on disk (they are in my project with a build action of "None") -  ValidateParent, ValidateChildren, and ValidateChild.  I then have 3 activities compiled into my assembly that build the input parameter collection and use the common ExecuteActivityFromXAML activity to invoke the 3 XAML files - ExecuteValidateParent, ExecuteValidateChildren, ExecuteValidateChild.  The ValidateChildren activity is supposed to validate rules on the collection and then loop through each child object and call ValidateChild.  I can call ExecuteValidateParent with no error if it does not reference the other activities, but when I try callt he ExecuteVal

error with "Create new content" type Translation Management Library


I added the Translation Management feature today, using the following command line:

stsadm -o activatefeature -name TransMgmtlib -url http://mysite

everything seemed to work fine, as no error occurred at this stage, and when I go to my top level site settings, click on "Site libraries and lists", then "create new content" I now see "Translation Management" as an option.

I select this type, click Create, complete the first part of the 'wizard' (Name and Description, etc.), then I'm on step 2 and this is where the error occurs. 

  1. The Workflow select box is disabled, and from the articles I've read this should be usable.
  2. More critically, when I complete this form and click Next, I get a server error:

    Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. 

I've googled around, and tried updating various items in my web.config and machine.config, but I cannot find the solution. A lot o

"Duplicate content type name" error when trying to create a site from a custom site template


I am getting "A duplication content type name 'Approval' was found" error, when I try to create a new site based on a custom template.  These are the steps that result in the error:

  1. Create a new blank site.
  2. Without making any changes, save the blank site as a site template called "test".
  3. Try to create a new site based on the "test" template.
  4. Get the above error.

I did notice that when I tried creating site from the template in a different area of my site collection, the error name changed from "Approval" to "Requestor". 

As it stands I cannot use custom templates in my site collection.  Any advice on how to overcome this error?


when i tried to create new external content type in sharepoint designer in ribbon it show error like

when i tried to create new external content type in sharepoint designer in ribbon it show error like  "  The server was unable to process the request due to an internal error, for more information about the error, either turn on includeexceptiondetailsinfaults (tither from servcebehaviorattribute or from the <servicedebug> configuration behavior) on the server in order to send the exception infromation back to the client, or turn on tracing as per the microsoft .net framework 3.0 sdk documentation and inspect the server trace losgs.  "

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


create user wizard login error message dont show in a message box?




i am using create user wizard and capturing other information within content template when a new user

registers. Some of the textboxes are binded to required field validators.


there is a validation control on the page and ShowMessage box is True.

If they dont complete some of the text boxes then the message box pops Up with the error message.

It does not however include information errors like "User already exists" or Email address already exists

from the create user wizard membership  UserName and Password Textboxes


is it possilbe to hook all of these up so I get one message box with all errors including membership ones?




ERROR [HY000] [Informix .NET provider][Informix]Database locale information mismatch


Hi, there is an upgrade to my infimacs server and my web application encounter this error after the infimacs is upgraded.

Below is the information on the server before/after the upgrade.

Before            After

---------       -----------  

Solaris 8      Solaris 10

IDS 9.40     IDS 11.50

The web server where the web application hosted is running IBM Informix Connect 2.81. There is no such error before the upgrade is done.

As a developer, i have IBM Informix Client-SDK 2.90 installed on my local pc and debug the page where the read is needed from infimacs but no such error found.

The error come out only when it is hosted on the web server where IBM Informix Connect 2.81 is installed.

I have gone through many articles and it suggest me to set the environement  variable in the server :  DB_LOCALE=en_us.819.

I haven't try this solution but i think that this might not be the best solution.

Is it possible to to to have this settin

Activation error occured while trying to get instance of type Database, key "DBName"


Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />

Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)

Database myDB=EnterpriseLibraryCo

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Parser Error Message: Could not load type MasterPage File



Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'wamsilverlight.Web.Wam'.

Source Error:

Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Wam.master.cs" Inherits="wamsilverlight.Web.Wam" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Source File: /Wam.Master    Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927


All of the following have been tried over and over again:

1.) Delete all existing .dlls

2.) Delete MasterPage File and recreate it.

3.) Delete MasterPage perform a c

override error message (The value 'test' is not valid for Age) when input incorrect data type for in


Hello everyone,

I've tried to override error message when input incorrect data type in input field on HTML form. For example I have the model like this.

public class Person
public string FirstName {get;set;}
public int Age {get;set;}


For view, I put text input for Age to get it value.

When type some string in Age text box like 'test' and press submit button. I got this error message

The value 'xxx' is not valid for Age

However, I want to change this message and try many way. There 's nothing effect this message value.

Please could you help me to solve this problem.

Error converting data type varchar to numeric.


I create a form to record data using ASP.NET and SQL database...
when i run the project show error "Error converting data type varchar to numeric"

what's the problem actually.i try to change in datatype in database..
but still showing error...


Create My Site for FBA Users Error


Hi Guys,

I am trying to create mysite for FBA Users programatically (FYIP: I have done all the configurations for FBA in SSP and mysite host and I am able to create mysite from UI for FBA Users). The problem exists only when I am creating MySite programatically!!!










Security trimmed URL throws an error if not logged in

On a Moss 2007 site, using FBA - I have an issue with security trimmed items within Lists.   There is not a problem with direct url links to non-list items.  
For list items - here is the problem, when a user is not logged in and follows a direct url link from an email or newsletter to security trimmed items within a list - it throws an error instead of offering a redirect to login?

More info:  This is only occurring for individually security trimmed list items that have had anonymous access removed.  When a whole list or library has had anonymous removed, the links work fine (login page appears, log in, taken to original link).

Why is that and is there a way to avoid the error?

If it is of help, this is the error. Thanks in advance.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an insta
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend