.net

How do you centralize error message text, prompts, and other site verbiage?

I'm using ASP.NET MVC 2.0 and C#. I've done this before by rolling my own solution using the database, but I was wondering if there's an easier way or an established practice for doing this. I'm also hoping the solution I choose makes it easy to support multiple languages later. ...

ComboBox:How do i set the height of ComboBox?

I have a ComboBox a on form, and its' default height is 21 - how do i change it? ...

WIndows Form & Multithreading: Closing all forms via background thread

Hello Friends, I am new to .NET Windows application & unfortunately, to the MultiThreading. My problem is as below: I have application in which I spawn three threads (3: activity thread, snapshot thread, upload thread) which every minute take snapshot of screen and logs mouse-keyboard activity in database. Now, every time I insert a re...

Website stops running in ie7 compatability mode after linkbutton pressed (Steps to fully recreate problem included)

First off, I am running my website in IE7 Compatability mode with the following code. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" > I have a web page that has a gridview with a link button in it. When I click the link button a new page opens in a seperate window(or tab). However once I do this, the original page is no l...

T4 Template relative path

I have a T4Template: <#@ template language="C#" debug="True" hostspecific="True" #> <#@ output extension=".cs" #> <#@ assembly name="System.Web" #> <#@ assembly name="System.Web.Mvc" #> <#@ import namespace="System.Web.Mvc" #> <#@ import namespace="System.IO" #> <#@ import namespace="System.Web" #> using System; namespace MyNamespace...

Load assembly from memory

Hello, I am porting a Java application where classes are loaded and "executed" at runtime from memory (a byte array). I am trying to achieve the same thing in C#, but I am having problems (System.IO.FileNotFoundException exceptions) when trying to load assemblies from byte arrays (using the AppDomain.Load method). static void Main(str...

convert html file into PDF file?

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + IIS 7.0 to develop web application. I want to convert html file/page/string into PDF file. Any built-in solution from Microsoft to do this? The top issue is about paging, i.e. how to map html conent to converted PDF page? e.g. I want to display an html table and an image...

Data Import/Export of large data sets with .net

Hi, has anyone experience with import and export of large collections (from a database in this case) with .net. Using the database export itself is not possible because there are multiple database backends supported and i need this for a kind of platform independent export/import. The problem here is that the XmlSerializer or DataCont...

Stored procedure return varchar

Hi! I am trying to create stored procedure that gone return varchar value, and that value I need to display in textbox. This is the code for stored procedure: Create PROCEDURE Status @id_doc int, @Name varchar(50) OUTPUT AS select @Name =items.name from Doc,Items where @id_doc=IDN and doc.IDN=Items.ID return @Name This is the...

.Net Unit test compile error - The type or method has 2 generic parameter(s), but 1 generic argument(s) were provided.

We've got a generic class which contains a private class which uses the outer class's generic type parameter. Example: public class Foo<T> { private class Bar : IGrouping<Guid,T>{ } } The problem is that we get a compile error in a unit test project which states "The Type or method has 2 generic parameter(s), but 1 generic ar...

Calling a web service without using soap

How can I call a web service directly without using soap? I basically want to use the web service like a class library and have the same performance as if it was a class library. The code I am calling is in the same project as the web service ...

How can I (re)format a partition from a .net application?

I have a C++/CLI application which needs to format a partition (single drive letter in Windows XP Embedded). Is there any other way to do this besides launching the standard windows format program? ..or is that my best option? ...

Solution wide app.config / web.config?

Hello, I have a solution with one asp.net-mvc-2 project, one web service, one class library and three normal desktop apps. Currently I need to copy all app.config settings from one project to the other. That is a nightmare if I want to change something. I know there is a solution to store all these information in the global .config fil...

Application Title is missing when pinned to start menu.

Hi, I have a problem with pinning my c# application to the start menu in Windows 2008 R2. The application pins with the correct icon but the application name is missing. In effect I just get the icon displayed. My csproj has an msbuild import that points to a custom target file to automatically generate the AssemblyInfo class. I hav...

c# counting clicks

I have a timer and in 30 minutes I want to count clicks and show it in a textbox. but how? here is timer code: decimal sure = 10; private void button1_Click(object sender, EventArgs e) { button1.Enabled = true; timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { sure--; label3.Text = sure.ToString(); if (...

Length of time temporary file kept?

I'm working on a program which will generate some temporary files, wait for the user's input on a few things, then use these temporary files for an operation. I was wondering if I can reliably expect that these temporary files will not go away before I am completely done with them (e.g. will they disappear while the user is working?). ...

Installing a .NET Windows Service on a machine that doesn't have Visual Studio installed

Hi all I have created a Windows Service (called MuskOx) which runs on my development machine (which obviously has Visual Studio installed). The Bin folder of the project contains the following files: InstallUtil.InstallLog muskox.InstallLog muskox.InstallState MuskOx.exe.config MuskOx.vshost.exe MuskOx.vshost.exe.config MuskOx.vshost...

Calculating number of users accessing my website at a specific point of time

Hi... I am having a web application built using ASP and Asp.Net.I want to restrict number of users accessing this website.There are ways available separately ASP and ASP.NEt but,not for combination of these two. MayI know if I could just use Application["somename"] in global.asax One more thing is when a user leaves the application, whi...

Simple ListView Question

Hi All When I click a button, I am trying to insert a new listview item. It is supposed to go in a certain Group, and it will have an item, followed by two subitems. But my code isn't working. ListViewItem lvi = new ListViewItem(itemtext, grouptext); lvi.SubItems.Add(subitem1); lvi.SubItems.Add(subitem2); ...

How to find out the ProductName property of another assembly?

I have two assemblies A.exe and B.exe. Both are Windows.Forms .net 3.5 assemblies. A.exe knows that B.exe is in the same directory. How can I find out the ProductName of B.exe from A.exe? ...