.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

C# target 32bit and 64bit desktops with SMO included

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
I have an application that uses three SQL 2008 R2 SMO assemblies.  I need to target 32 and 64 bit machines that are running either 32 or 64 bit versions of SQL 2008.  I have no idea how to handle an Any CPU build for the application.  Since the SMO assemblies are either 32 bit or 64 bit, do I have to create a 64 bit build of my app and also a 32 bit build of my app.  I have no idea how to proceed with the build at this point.  This is my first app to support 64 bit machines and servers; I have only had to work in 32 bit in the past. Also, I do not know where the best forum for this question would be.  It is not a SQL question unless the answer is in the SQL assemblies.  I am developing on 64 bit Win 7 with VS 2010 and .Net 4. The C# app is wpf. The application needs to run on 32  and 64 bit Vista machines with 32 and 64 bit SQLExpress 2008 instances, and it also needs to run on 2003 and 2008 32 and 64 bit servers running 32 and 64 bit SQL 2008 servers. Any help would be appreciated.  I expect that I don't know what I don't know on compiling apps and including assemblies in an Any CPU world. Thanks, LD

View Complete Post

More Related Resource Links

SharePoint 64bit + 32bit Office JET Drivers?

Hi Guys, I'm in a bit of a pickle here! I have a document library which contains Excel files on Moss 2007 (64bit). When a file gets upload to the library, a workflow kicks off with some custom activities I've wrote in C#. One of the activities opens the SPFile object (the Excel data) for the SPListItem object thats currently been added. It dumps the stream to a temp file on the hdd (a random .xslx file) and attempts to open it.... but i get this error:   The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.   So i dig about a bit and it turns out there is no 64bit jet drivers for windows 64bit. If i compile my activity to 32bit, it doesnt seem to be able to interface with the 64bit installation of sharepoint!!   What can i do to get round this?!   Many thanks! Will

ODBC 32bit is launching 64bit ODBC administrator. No menu opens 32bit.

In Windows 7 maybe all 64bit OS's are setup for 2 different types of ODBC connections.  Try running these and adding your connection in one or the other.
I have not found the navigation for each version as the control panel I think uses 64bit even the one marked 32bit seems to be pointing to 64bit.  There is no visual key that tells you which one you are using.  If you add a key called 64bit and then click the 32bit icon you still see the 64bit.  Most applications will use the 32bit ODBC so you will have to manually navigate to add connections.
To setup an ODBC link for 32bit application you must use
To setup an ODBC link for 64bit application you must use

My question is why does the 32bit icon point to the wrong one?  Is there a KB or update for this?

64bit/32bit UDL properties editor?


I'm used to creating udl files and using the built-in Data Link Properties editor. But now I have a 64bit workstation, and when I open a udl file with the editor, it only gives me a list of 64bit drivers.

Is there a way to open a udl in a 32bit editor?


Migrating Jobs: SQL 2005 32bit > SQL 2005 64bit


I am trying to migrate jobs between SQL Server 2005 32 bit to SQL Server 2005 64bit.  I follow the steps in the KB Article to copy a job by scripting it and then running the SQL against the new server.  The query executes fine, but it only creates a skeleton of the job with nothing in the body.  There is no schedules, steps, name, etc.  The resource versions are different and tonight my plan is to apply the service packs to ensure there is no discrepency in either version.  Also these are all TSQL jobs not DTS packages.  Any ideas?

can we install SQL Server 2008 R2 - 64bit on Window Server 32bit?

can we install SQL Server 2008 R2 - 64bit on Window Server 32bit?

Wireless Web: Microsoft Mobile Internet Toolkit Lets Your Web Application Target Any Device Anywhere


If you've built Web sites using ASP.NET, you'll welcome the Microsoft Mobile Internet Toolkit (MMIT). MMIT extends the Visual Studio .NET IDE you already know by providing new controls for handheld devices letting you easily develop applications for wireless devices. This means you can write less code while adapting it to more devices. Not only does MMIT integrate with Visual Studio .NET, it extends ASP.NET as well. This article gives you the background you need to write, test, and deploy a site with MMIT and make all your code able to target specific devices for a custom fit.

Paul Yao and David Durant

MSDN Magazine November 2002

Windows Forms: Developing Compelling User Controls that Target Forms in the .NET Framework


In the beginning, writing controls meant dealing with Windows messages. Then came Visual Basic controls, which introduced methods, properties, and events. Later, ActiveX controls, which ran atop COM, became popular. While each innovation in control writing brought more flexibility, nothing has matched the versatility of the new .NET Windows Forms controls and Web Forms controls. This article, the first of a two-part series, introduces the reader to Windows Forms, beginning with their inheritance from one of the .NET CLR base classes, which makes control creation much faster than before. Control programming is illustrated through the development of a login control. The equally flexible Web Forms controls will be covered in Part 2.

David S. Platt

MSDN Magazine April 2002

Extra file is included on the Page directive inherits =



I am trying to understand where the additional file name is coming from in my Page directives Inherits

attribute like so :

inherits ="Track_Milestones2, App_Web_techsrvcs_track_milestones2.aspx.cdcab7d2"

Is the result of this app being published on my local server at one time or could this

page have been compiled on a server ?

Thanks for your insights !

Reporting Services in SharePoint integration - configurtion errors in 64bit version



We have build an MOSS 2007 environment on 64 bit servers. We build the reporting services server and configured in SharePoint integration mode. Initially configuration looks fine with reporting services integration with green indicators.


After creating a web application and accessing the web site from the report servor, i have found the following errors:


Server Error in '/' Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'RSSharePointSoapProxy, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot fi

Connecting to Oracle on 64bit OS

We have a 64-bit implementation of MOSS 2007. I recently installed the SharePoint SDK to use the Application Definition Designer to connect to Oracle. I enter the connection string and then I get this:

Attempt to load Oracle client libraries threw BadImageFormatException. The problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

I have verified that the server contains the 64 bit version of the Oracle client installed both with the instantclient and with system.data.oracleclient.dll. The only thing I can think of is that the tool was compiled as a 32bit application.  Is there a 64bit version available? Is there something else that I'm missing?

Target Audiences not working


Microsoft Office SharePoint Server Enterprise 2007 Version:

I created a Target Audiences for a Security Group that I created for a Pilot program that is being kicked off.  I only want the Security Group to see it.  I logged onto the site as a member OUTSIDE of the Security Group and I still saw it.  I have the example below, with the security group from Active Directory.  Any reason why it would not work?

Below is an Announcement on our Corporate Intranet site for educating users on Information Technology and computer related items.  It is a portal that we would like them to go to, to get all of their information.  I have yet to break up items based on Target Audiences, but now I think it might be a great time, as I have a way to use it that will be around for a few weeks.

Title Test  
Body Test
Expires 8/25/2010  
Target Audiences Security Pilot Group


Thank you.


change form target from javascript


Salam to all,

in my page, i have an iframe which have a src for another page,

the inner page have a Forms, buttons.. ..etc. the target for the form in the inner page is "self"

i need to run a javascript code from the parent page to change the  inner page form target to posted the values in a Blank window.

how can i do that ?


gdi32.dll + unsafe code on 32+64Bit Windows

Which target cpu should I use to compile a .NET 3.5 app (developed on a 32 Bit System) that contains an assembly which uses [DllImport("gdi32.dll")] static extern IntPtr CopyEnhMetaFile(IntPtr hemfSrc, IntPtr hNULL); and which also has the option checked: "Allow unsafe code" because of the following code: ((byte*) dst.Scan0.ToPointer())[(dst.Stride*y) + x] =... so that the app is able to run both on 32 and 64 Bit Windows ? If the answer is "x86", does it mean that all referenced assemblies of the app have to be compiled with "x86" or just the "app.exe" ? Thanks.

Windows 7 64bit Registry access using x86 assembly

Hi guys, I have an assembly that is complied in x86 release mode. The assembly tries to access  a particular registry key in Win7 the key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion  -> ProductID(tried to read this value) As the assembly is in x86 it tries to look for the key in SysWow64 node HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion -> ProductID(tried to read this value) When i went through the registry i found that the string "ProductID" is missing (!) .. (may be because i have trial version of windows 7 x64)? I just wanted to ask , is there a way to read registry key (not in wow6432node ) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion  -> ProductID  in x86 mode? Im using the following  code RegistryKey regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", false); //reads in wow6432Node for x86 assembly string strProductID = string.empty; if (((regkey != null))) { // Get key Value of ProductId. strProductID = (string)regkey.GetValue("ProductId"); if ((string.IsNullOrEmpty(strProductID))) { //try reading another path for "ProductID" } } return strProductID ; PS:When i complie the same assembly as "Any Cpu" , the above code returns corr

master (MSX) target (TSX)

Hi! Is it possible to have SQL Server 2005 as a master (MSX) and SQL Server 2008 as a target (TSX) . Im getting this error SQL Server WMI provider is not available and This method cannot be called on the server version 10.0.. thanks!

SQL Server Configuration Manager: Connection to target machine could not be made in a timely fashion

I have a SQL Server 2005 box that was moved from a domain environment to a non-domain environment and was never dropped from its original domain before moving over.  Subsequently a new domain was created at the data center this SQL Server box now resides in.  The machine was dropped from its old domain and joined to the new one.   All the while the service accounts were set to the local admin account.  When I tried to start the Configuration Manager I got the message "Connection to target machine could not be made in a timely fashion.".  I read some blog entries and tried changing all the service accounts to Local System and the error message still came up.   All of the SQL Server services run fine.  It is just this management console that I cannot open.  I wasn't with this employer when this box was moved to the data center so I do not know if it worked prior and there isn't anyone here that could give me its history.   Any help would be appreciated.
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