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


Post New Web Links

How do I register C# COM server as a singleton?

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :.NET Framework
 

I have a C# .EXE that implements a COM interface that needs to be a singleton.  However, I have been unable to register the .EXE so that only a single instance will be shared between multiple processes.  Currently the .exe appears to be loaded into each process space as if it were a .DLL.

Each instance works correctly except that the resources owned by the COM server are not shared between processes.

I'm reasonable sure that the only problem is how the .EXE is registered.




View Complete Post


More Related Resource Links

Linked server and sensitive to register name of table. Problem with UPDATE.

  
Hi All. I try to work with table with "sensitive to register" name through Linked Server (MSSQL 2005/2008) and get the problem with UPDATE statement. Reason: MSSQL generates UPDATE statement with "un-quoted" table name. With SELECT/INSERT/UPDATE - no any problems. ----- Linked Database Information: 1. Firebird 2.5 2. OLEDB Provider: IBProvider v3 3. Database dialect: 3 Metadata: CREATE GENERATOR "GEN_ID_TableWithMixName1"; CREATE TABLE "TableWithMixName1" ( TEST_ID INTEGER NOT NULL, "Col" VARCHAR(100), DUMMY_COL INTEGER, CONSTRAINT "PK_TableWithMixName1" PRIMARY KEY (TEST_ID) ); CREATE TRIGGER "BI_TableWithMixName1_TEST_ID" FOR "TableWithMixName1" BEFORE INSERT AS BEGIN IF(NEW."TEST_ID" IS NULL)THEN NEW."TEST_ID" =GEN_ID("GEN_ID_TableWithMixName1",1); END; ------- MSSQL Test 1. MSSQL: select * from IBP_TEST_FB25_D3_V3...TableWithMixName1; IBProvider: Command_Execute   SELECT "Tbl1002"."TEST_ID" "Col1004",         "Tbl1002"."Col" "Col1005",         "Tbl1002"."DUMMY_COL" "Col1006"   FROM "TableWithMixName1" "Tbl1002" No Problem ------- MSSQL Test 2. MSSQL: delete from IBP_TEST_FB25_D3_V3...Tabl

Error while trying to register DLLs for Microsoft Jet on Windows Server 2008 R2 64bit

  
Hello! I'm having issues with importing Excel spreadsheets into Microsoft SQL Server 2005 on a Windows Server 2008 R2 64bit server.  After browsing the web, it appears that the problem is with the DLL's used by Microsoft Jet.  I've thus attempted to re-register these DLL's.  However, I am receiving the following results. c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjetoledb40.dllSuccessful c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjet40.dllSuccessful c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjint40.dllThe module "msjint40.dll" was loaded but the entry-point DLLRegisterServer was not found c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjter40.dllThe module "msjter40.dll" was loaded but the entry-point DLLRegisterServer was not found c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjtes40.dllSuccessful c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\mswstr10.dllThe module "mswstr10.dll" was loaded but the entry-point DLLRegisterServer was not found I've set the application pool for this site to use 32bit.  Please note that due to my role on the team, other options such as using ACE are not available to me, unless I can prove that I've exhausted all other options. Thoughts? Thanks,Mike

Want to register a COM DLL as a library and not as a server??

  

I have a COm DLL. And want its functions to be called from an MFC Application. So I wnat to register the COM DLL. I registered using regsvr32 command. But it is registered successfully AS A SERVER. But since the function call is not happening I want it to be registered as a library. Can I get kind help regarding how to register a COM DLL as A Library rather than as a Server.  I am a fresher to this COM concepts, MFC VC++. Can anyone help me at the earliest.

Thanks in advance.

 


Error: The SQL Server Service account does not have permission to register the supplied URL on the e

  

Hi,

I've developed a SQL webservice which works absolutely fine on the server but it doesn't work on my VMware. It generates following error:

"The SQL Server Service account does not have permission to register the supplied URL on the endpoint.  Use sp_reserve_http_namespace to explicitly reserve the URL namespace before you try to register the URL again. An error ('0x80070005') occurred while attempting to register the endpoint."

Here's my webservice:

CREATE ENDPOINT [SQL_Webservice] 
	AUTHORIZATION [DOMAIN\Administrator]
	STATE=STARTED
	AS HTTP (PATH=N'/TEST', PORTS = (CLEAR), AUTHENTICATION = (NTLM), SITE='192.168.xx.x', CLEAR_PORT = 80, COMPRESSION=DISABLED)	
	FOR SOAP (
WEBMETHOD 'GetCountries'( NAME=N'[TestDatabase].[dbo].[GetCountries]'
, SCHEMA=DEFAULT
, FORMAT=ALL_RESULTS), 
WEBMETHOD 'GetCities'( N

SSMA for Access 2007 SQL Server 2008 Unable to Register

  
I have downloaded and installed the SSMA 2008 for Access 4.2 QFE1.exe on my Windows XP and Office 2007 Ultimate laptop, and tried to use it, but when the License Management pop-up opens and I click on the license registration page link on Step 1 of the instructions, IE opens and goes to the RegSysProfileCenter and displays the error message "An unknown error occurred while processing your request. This is most likely due to a connection failure. Please try again."  Why is this happening.  What's wrong with the website/page.  An "unknown error" means there's no known cause.  What's happening?  I keep trying over and over and over...  I've also tried to use it on my other Vista machine, but it keeps wanting to install Access 2010 runtime files (Office 2007 is installed) which it can't download - so it fails there too.  This is really getting frustrating.  Please show me you are truly "Microsoft" and NOT "Microcrap", which is a growing trend...  Thanks.

Cannot Register New Server in MS SQL 2008 Express

  

Hello!

Hope somebody can offer a solution.

Have:

Windows 2007 Home 64 bit edtion.

Installed MS SQL 2008 Express - no problems

Installed AdventureWorks2008R@ sample database locally on Windows 7....with all defalt settings

Went to register New Server Registration

On General Tab listed Serfer Name as AdventureWorks2008R2...as suggested by the Tutorial.

On Connection Properties tab....in Connect to database select Browse Server and ...

Get error msg: A network-related or instance-specific error occured while estabilshing connection to SQL Server.

Do not have have MS . NET Framework 3.5 installed...

Have MS . NET Framework 1.1 and MS . NET Framework 4 Client Profile.

 

Any suggestions?

Will be much appreciated.

 

Thank you!

 


Singleton Design Pattern in C#, Vb.NET

  
Ensure a class has only one instance and provide a global point of access to it.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

  
In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.


jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.

MS SQL Server: Disconnect Users From Database - Kill User Session

  
If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

  
We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.

CLR Integration With Microsoft SQL Server

  
Transact-SQL provides as much flexibility as possible but, because it is not a real programming language, it has some shortcomings about many issues (memory management, exception handling, debugging, file processing (or streaming), object-orientation (classes), or thread management). Transact-SQL also lacks features of normal libraries (arrays, collections, serialization, expressions, or string manipulations, etc).

IP Address Blocking or Restriction in SQL Server

  
"is it possible to block connections to SQL Server based on IP address". As far as now there is no official way in SQL Server to block the connections in SQL Server based on IP address. However this can be done from the OS end, we have the following three options available, refer HERE for more.


.Firewall
.IPSec
.RRAS IP Filter

Singleton Design Pattern in Asp.net using C#

  
When we want to make a only one instance of a class and also making sure that there is a global access point to that object then the design pattern we user is called Singleton. The pattern ensures that the class is instantiated only once and that all requests are directed to that one and only object.

Singleton Pattern-Creational Patterns

  
The Singleton pattern is a specialist creational pattern as it's primary focus is to facilitate a single shared instance of our object rather than to decouple our client from the object's implementation as with the other creational patterns.
Categories: 
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