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

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

How to create Object in Object Test Bench

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
Hi,I used Object Test Bench to test my classes in VS 2008 professional edition . Right click on Class name and then selected create instance ,then its Constructor, there comes a dialog box, that just gives a message and a TextBox field is present there, i filled that field with any name and clicked OK.Then error message comes that "Create Instance Failed" and its error code is "0x80004005" . What's this ? How to instantiate object of my classes ?

View Complete Post

More Related Resource Links

Create COM object from ProgID in a separate domain

Hi, How should I create COM object from ProgID in a separate app. domain? After I created corresponding Type object by means of Type.GetTypeFromProgID, I cannot use neither Activator.CreateInstance nor <MySeparateAppDomain>.CreateInstance because both require assembly name as one of the arguments... but as I said before I have no RCW assembly - just a ProgID. Those Activator.CreateInstance overloads which have argument of AppDomain type do not accept argument of Type type, only argument "assembly name" (of String type). And neither of <MySeparateAppDomain>.CreateInstance overloads accept argument of Type type (all require assembly name and type name). Any ideas?!

Proxy failed to create remote object on the server

Hi, I am using .net remoting for inter-process communication between two processes on the same machine 1.   The first process is one of the Office application: Ecxel /   Word /   PP 2.   The other process is another application that interacts with one of the above. For that it needs office application object. For example: Excel The solution is comprised with 3 projects: Project #1: The remote object is a simple Called RemoteOfficeApplication – that simply wraps the required application object (Word / Excel / PP).   Project #2: The Server is a simple Office add-in, written with a Visual Studio Extensibility -> Shared project. This add-in is instantiated whenever Excel is lunched. This project reference project #1. Code: var channel = new TcpChannel (5003); ChannelServices.RegisterChannel(channel,true ); RemotingConfiguration.RegisterWellKnownServiceType( typeof (RemoteOfficeApplication.RemoteOfficeApplication ), “AppObj”, WellKnownObjectMode .Singleton);   Project #3: The Client is the process that requires the application object. This project also reference project #1. Code:   //Get Remote object proxy object remoteAppObject = Activator.GetObject(typeof(RemoteOfficeApplication.RemoteOfficeApplication), “tcp://localhost:5003/AppObj" ); //Cast the proxy var r

How to create an extremely large array/object (> 2 GB) without using jagged arrays ?

Hello,I had implemented a matrix scaling algorithm in Java (64-bit) for a university project and have now implemented the code in C# with .NET 3.5 64-bit. One of the operations I did in Java was creating a rectangular array with double[][] = ... (in C# this is a jagged array!) to store a symmetric matrix which is used as input for the algorithm. Since I was using matrices with n up to 30720, memory usage for the single matrix object was around 8 GB in it's maximum and with matrix multiplication around 20 GB.So... now I implemented this in C# and I am shocked to see that double[,] (rectangular arrays) can only be 2 GB in size even on 64-bit! That means that for matrices with n larger than ~15000 I will get OutOfMemory Exceptions although there is a huge amount of free memory (I have two quad core systems with 12 GB and 24 GB Ram). When I use jagged arrays in C# (i.e. double[][]) I can create larger matrices. That is because I have one small array with the size of the row number (i.e. n) and then for each row an array of size n, but they are all single objects so I don't reach the 2 GB per object limit. The problem with jagged arrays is that they are horribly slow for matrice calculations compared to rectangular arrays and even slower compared to single dimension arrays.Actually I intended to rewrite my code and simulate the matrices in single arrays (see sample code below) bec

How to Create SiteCollection through SharePoint Object Model?

hi all, i want to create site collection through programmatically. i used below code but iam getting error as "object reference not set to instance of an object"   SPSite site = new SPSite("http://servername:7833/");   SPWebApplication oweb = site.WebApplication;   SPSiteCollection sitecol = oweb.Sites; sitecol.Add( "sites/sitename", "sitename", "welcome to site collection", 1033, "STS#0", "Domian\\user", "User Display name", "user mailID"); oweb.Update();   iam getting an error at sitecol.add line the error is "Object reference not set to an instance of an object". please suggest me in order to remove the error. please suggest me if is there any other way to create site collection through programmatically. thanks in advance..

Create a datetime object as dd/mm/yyyy

Hi i want to create a datetime object in the way dd/mm/yyyy but the defualt behaviour of datetime object is mm/dd/yyyy. I want this because my user enters date in dd/mm/yyyy format and i want to apply different additions and subtrations on this format. I know how to display dates in different formats. 

Automation server can't create object

Automation server can't create object  I have this code working another server but not it stopped working  [CODE] <%@Language=JScript%> <% var mail = Server.CreateObject("CDONTS.NewMail"); mail.BodyFormat  = 0; mail.MailFormat  = 0; mail.ContentBase = ""; mail.To = "mZaragoza@xxx.com"; mail.From = "moisesz@xxx.com"; mail.Subject = "subject"; mail.Body = "tmpBody"; %> [/CODE] Error  Microsoft JScript runtime error '800a01ad'  Automation server can't create object  /app/test/mail3.asp, line 3  I have this code working another server but not it stopped working <%@Language=JScript%> <% var mail = Server.CreateObject("CDONTS.NewMail"); mail.BodyFormat = 0; mail.MailFormat = 0; mail.ContentBase = ""; mail.To = "mZaragoza@xxx.com"; mail.From = "moisesz@xxx.com"; mail.Subject = "subject"; mail.Body = "tmpBody"; %>Error Microsoft JScript runtime error '800a01ad' Automation server can't create object /app/test/mail3.asp, line 3 

How to create one instance of COM object that can be accessed from custom fields/workflows

Hi, Ive got a COM-object that is used to perform some actions on another server, and i can use only one instance of it ... But : 1. my custom fields must interact with it for fetching data 2. my custom workflows must interact with it for posting data So the question is : How to create only one instance of COM-object which can be fully accessible from custom fields/workflows ( custom too ) Thanks :)

Use the NEW keyword to create an object instance.

Private Sub textadd(ByVal sender as Object, ByVal e as System.Windows.Controls.TextChangedEventArgs)         txtfirstname.Text = txtdisplayname.Text 'TODO: Add event handler implementation here.     End Sub I almost wasted hours on figuring this error, I don't know how to fix this I got this error

Create List Sharepoint Client Object Model Access Denied



I am trying to create a silverlight application by making use of the SharePoint 2010 Client Object Model using the following code:

private void CreateList(object sender, ClientRequestFailedEventArgs e)
  ClientContext ctx = new ClientContext("http://server");
  ListCreationInformation lc = new ListCreationInformation();
  lc.Title = "FlexiTime";
  lc.Description = "";
  lc.TemplateType = (int)ListTemplateType.GenericList;
  List newList = ctx.Web.Lists.Add(lc);
  System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(CreateListCallback), ctx);

private void CreateListCallback(object s)
  var context = (ClientContext)s;  

The error I receive is as follows:


Urgent How to Create it ,Object Data Source ,Linq and sql or other any way


my query is



my data is

HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    Edlink
HR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    Edlink
HR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    Edlink
HR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010  

Unable to Create Object Variable for Linq Data Class


For some unknown reason I suddenly am unable to create an object variable for a Linq Data Class. If I create a new project and try the process again with the same database everything works as advertized.

The code I am using is Dim db As New RoggDataContext  which gives me an error on the object variable "db": Overload resolution failed because no accessibility 'NEW'  accepts this number of arguments.

I have looked inside every file in the Web Project like the web config to check the connection string, gobal, and designer.vb looking for any errors whit no JOY.  I also tried to create a new form and code behind with a button and received the same error.

This is mind blowing because as I already stated, I can create a new Web Site and the problem goes away.

Any help is appreciated!



How to create global object and let everybody use it and several questions


i want to create a global object and my all users should be using it


here comes several questions


my web server is working like a web farm

there is hosted only 1 website but it has 12 w3wp.exe 

my session state is aspnet_state


so if i use global object how many times will it be created

i mean how does this thing works


also all users will be excessively accessing this object

would this cause problem ?


and how can i create this object and use it


also can this object be hash table


thank you

how to create class and acess member using object

hi i am a new user to C# .net can any body help me to write a new class in c# AND HOW TO ACESS methods and members using its object thnks in advance

Failed to create a database object


Hello Friends,


I am receiving the following error:

"Failed to create a database object. Please contact your system administrator".


Environment: JSP Application accessing from chrome, SQL 2000, Resin Server.


Last Activity: Re-installation of sql server 2000. Restore of database.




create and open global database connection object


Hi to everyone:

I`m trying to install the allinta cms software www.allinta.com, I have already create a MySQL Data Base, but when I try to launch my cmsadmin I t appears an error

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'dbConnectionStr'

/cmsadmin/inc/db_connection.asp, line 75

IT  seems to be the Object Connection, could somebody help me to give the right code instruction please, I don´t have an idea on how to make it.

At this moment I opened in dreamweaver and it´s

Set objConn = Server.CreateObject("ADODB.Connection")

Create SPUser object using user credentials on claims based site.



I would like to create SPSite object and pass user token as an argument to make sure all operations are executed with SharePoint security trimming. Inside SPSite I am reading some file content using File.OpenBinaryStream() method.

I am not sure if there is a way to create SPUser using user credentials. I am able to get SPUser by getting it from SPWeb.AllUsers collection using user login name. However it doesn't work for claims based sites as login name for these users looks like i:0#.w|domain\username. 

Am I allowed to user code like this:

SPUser user = web.AllUsers["i:0#.w|domain\username"];

to get SPUser object? I know that 'w' from 'i:0#.w' string means that it is Windows user. What do other symbols mean? Is there any method which can generate login name from user credentials so I may use it to get SPUser from AllUsers collection?

Possibly there are some other ways to execute code for SPSite under some SharePoint user privileges?

P.S. All my code is running out of SharePoint context. I have tried to user windows impersonation but got Access Denied error.

Thanks beforehand for any help,


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