.net

Create project or solution-specific item templates for Visual Studio?

I know how to create project or item templates and install them. What I would like is to have item templates that are specific to a single solution. In this case I have an ASP.NET MVC project and I would like to have default templates that inherit from my base Controller class, my base ViewPage`1 class, etc. instead of the default one...

Is it possible to translate Oracle Forms6 application to Windows Forms (.net) ?

Is there any tool that would help to move/translate appliaction written in oracle forms6 to .net ? maybe not whole application at once, but maybe modules/forms(screens) to windows forms. I know that languages are different (pl/sql vs .net) but maybe that tool could make some template and programmer would be responsible to translate busin...

.net cf - launch explorer programmaticly

I am trying to launch explorer programmatically from my .Net CF Window application. But its throwing win32 exception. I have used same kind of code in desktop .Net version, and it always worked. (I am using Windows CE 5 and .Net CF 3.5 ) Following code throws Win32 Exception, Process.Start("\\", null); Unfortunately, i am using the c...

TransactionScope not rolling back with SqlDataAdapter.Update

I'm using SqlDataAdapter.Update with DataTables to update two SQL tables in a single transaction. If either insert fails I want to roll back all data. This is my code: using (var conn = new SqlConnection(_connectionString)) { conn.Open(); using (var scope = new TransactionScope()) { // Insert first table usi...

Is it possible to add some data to a Word document ?

Is it possible to add (thru the MS Word object model? or by editing file) some custom data (another file maybe?) Will be that data preserved after opening, changing and saving document in MS Word ? (I need to put some tracking data in docx during some report export, custom data will be used again during import) ...

Exception seen WCF/IIS7.0 Implementation NHibernate.HibernateException: Creating a proxy instance failed

Has anyone seen the following exception and knows what the cause is. Recently deployed code live and started seeing exceptions which forced roll back. On Windows Server 2008 and IIS7.0. The full stack trace seen below. NHibernate.HibernateException: Creating a proxy instance failed ---> System.Runtime.InteropServices.COMExcep...

Query excel spreadsheet for cell format.... (percentage)

I am using the .Net 4.0 and excel 2003 How can i use an oledb connection to retrieve the cell format of an excel spreadsheet... I specifically want to find out if a cell column (or cell itself) is in a numeric percentage format. I cannot seem to find this information in the GetOleDbSchemaTable method. EX: My web app reads numbers from...

Subsonic Strips trailing s from Table Name in Object names

I have a table called Group_Focus and when we generated our code with Subsonic 2.2 it's calling the object GroupFocu while the files are named GroupFocu.cs and GroupFocuController.cs. Is there anyway to get it to not strip off the s when it builds the objects? I'm using the following settings in my Provider settings in the web.config: ...

sending a file from one IP address to another IP address using c#

Hi, I want to set up a system with a Client-Server architecture. Problem: Sending daily log data from the client application to server. Both the client and server are on an internal network with different IP addresses. Possible Methods... 1) Using Socket Programming 2) Sending over Active Directory (if possible) 3) Sending file fr...

The right way to use Globals Constants

In almost every project, I can't decide on how to deal with certain global constant values. In the older days, when I wrote C++ programs which didn't used dll's, it was easy. Just create and .h file with a number of const that described certain constant values for my project. Then I had every file include it, and ta-da! It worked. Clean,...

retrieve details of users from the exchange server

I am using exchange server 2007 (outlook) to configure email accounts.. How can we retrieve the details of the users (mailboxes) present on the exchange server. This feature is there in outlook. By double clicking the id and checking details. But, how can this be done programmatically? (using c#) ...

How to import an .snk file generated with sn.exe in .NET?

I have created a key file with this command: sn.exe -k 2048 Build.snk I would like to read in this key with .NET. I haven't been able to find any document as to the format of the .snk, so I'm wondering if there's a way in C# to read in an .snk file? My original reason for asking the question was to use the .snk file for purposes...

What scenarios constitute a Non-Default Execution Context in .Net?

WaitHandle.WaitOne() has an ExitContext option to allow for temporary release of a resource lock before holding for another. This is useful in some cases where dead-lock or thread starvation may occur. The msdn documentaiton talks about a dondefault context. They only refer to examples which constitutes being in a nondefault context i...

How to parse nested environment variable?

I have a task saying: Read the environment variable from config file and parse the nested environment variables! ...

What steps do I need to take to implement forms authentication with roles?

I've looked around and I can't find the concise steps that I need to take in order to implement forms authentication in my web site. I'm using C# 3.5 with an SQL Server backend. I have a User table and UserRole table in my database. I have 5 Directories in my app that contain aspx pages. Admin Common UserRole1 UserRole2 Public I want...

Customize WCF Service endpoint address in IIS Host

Is it possible to change the endpoint address on a WCF service when using IIS Hosting, I current just point to the svc file but I would like to use RESTful commands? ...

Silverlight Object Binary Serialization to Database

Right now I am programming a multiplayer card game in Silverlight I am wondering how to store a object best binary in a sql database. I have a GameState Object which contains the current state of a game between two players. I want to store this object in a sql database that both player can access and change it anytime. How would you d...

Why GetHashCode is in Object class ????

Why GetHashCode is part of the Object class? Only small part of the objects of the classes are used as keys in hash tables. Wouldn't it be better to have a separate interface which must be implemented when we want objects of the class to serve as keys in hash table. There must be a reason that MS team decided to include this method in O...

Determining the reason why a .net windows-service won't start

I am trying to determine why a .Net service that I can successfully install on a wide number of machines won't start on certain machines. When the service is started on these machines the service instantly stops, so my assumptions are either that the users doesn't have sufficient privileges to install the service or that there is an iss...

Sending email from a .net application via a mail server with a self-signed SSL certificate

Hi, I installed hmailserver 5.3.2 and configured it. It receives and sends emails normally, but I wanted to use it to send emails from a .net/C# application located in another server, and for that I wanted to use SSL communication. Before, the application was configured to send emails via gmail, on port 587 and it worked ok, but now we ...