.net

acessing network shared folder with a username and password string in vb.net

i am using the following code to read the details from a network folder which is restricted for only one user shell("net use q: \\serveryname\foldername /user:admin pwrd", AppWinStyle.Hide, True, 10000) Process.Start(path) shell("net use q: /delete") when i run this to open any pdf or jpg or any other files except word/exc...

What is '=>'? (C# Grammar Question)

I was watching a Silverlight tutorial video, and I came across an unfamiliar expression in the example code. what is => ? what is its name? could you please provide me a link? I couldn't search for it because they are special characters. code: var ctx = new EventManagerDomainContext(); ctx.Events.Add(newEvent); ...

How to configure Entity Framework 4 to prevent drop when generate database

Hi, is there any option when updating classes in EF4 Modeller to disable the drop of all data and tables, just to append non existing fields and leave old tables and data untouched. I mean not to change every time on every little change to edit manual the SQL files. Thanks. ...

FireBird .net provider 64bit

I'm trying to get a firebird web application (IIS6 64 bit) to run. However I'm getting bad image format (bit difference incompatability) issues. Has anyone got any advice to get it running. Details AnyCPU application references the .net firebird driver (through nhibernate) which uses a native 64bit dll. There is a native 32bit dll which...

WPF: How to make Contextmenu select and forget?

I have a Contextmenu with a ListBox inside. Whenever I right click my control and select a value from my contextmenu the last selected value stays marked and I can't select that value again. The idea is, that I may select the same value within the COntextmenu in order to turn a property on or off. Should be quite basic, what am I miss...

pass elevated permissions to out-of-process server via Activator.CreateInstance

I have a process running with elevated permissions (defined through manifest file /asAdministrator) and would like to launch an out-of-process Visual Studio instance with elevated permissions too. Currently VS is launched for OLE Automation purposes with the code below: Type type = System.Type.GetTypeFromProgID(dteVersion); DTE dte = (D...

Programming issue while applying text to the third party control.

Hello I have used some third party controls in my windows application. There is a snippet which is being used in our code which re-initializes all the .text property of all the controls on the form. Everything works fine except for a control. This control is similar to the Windows Panel except for it has a dropdown appearance. This...

New NCover 3.4.2 makes all my MSTest unit tests fail

Yesterday, I decided to install the newest NCover version (3.4.2). However, when I ran it on my existing .ncover configuration file, the NCover output suddenly reported that all my MSTest tests failed. Of course those tests succeed when ran within Visual Studio. Because of this, NCover isn't able to determine any coverage. Somehow the o...

.NET: Writing DataAccess dll

I would like to write all data relations processes (general functions regarding with DataAccess via .NET) in dll and I want to use it repeatedly. What kinds of functions should have in that dll? Some want to use Stored Procedures , Some with Statements. Can you all suggest me? Please guide me! Thanks all! ...

System.Data.Common.DbDataReader

If I use this class to do a SELECT * FROM ... statement against a database, what method or variable of this class should I use just to give me a dump of the output from the SQL statement? ...

Have visual studio copy x64 DLL or x86 DLL when building a C# project

We're building a C# app that uses an external DLL for Sqlite.NET. This is a .NET dll but it embeds a C dll inside it and so it comes in x86 and x64 flavours. We add a reference to the x86 version in the project so when we build and run on x86 it's fine. Visual studio copies the dll to the bin folder and runs. On x64 it still copies t...

Enterprise integration of disparate systems

We're about to embark on a fairly large integration effort to kill off a bunch of Access and Sql Server databases and get everything into one coherent enterprise system. There are also a number of other systems (accounting, CRM, payroll, MS Exchange) that hold critical data that we need to integrate (use for data validation in other syst...

How to known the stack level reached in .NET?

How to know and then print out (in debug) the stack level reached in a certain moment inside a function call? ...

Strange FileNotFoundException occuring on production server in console application

Hi I have an application that works fine in my dev enviroment, but throws weird errors in the production enviroment, I checked the version of .net on my dev machine aswell as the production server , they both run 3.5.30729.01. The exception I get is a System.IO.FileNotFoundException. StackTrace: at System.Diagnostics.FileVersionIn...

HashSet versus Dictionary<T, K> w.r.t searching time to find if an item exists

HashSet<T> t = new HashSet<T>(); // add 10 million items Dictionary<T, K> t = new Dictionary<T, K>(); // add 10 million items. Whose .Contains method will return quicker? Just to clarify, my requirement is I have 10 million objects (well, strings really) that I need to check if they exist in the Data Structure. I will NEVER iterate....

Why does VS2005 skip execution of lines when debugging managed C++ without optimizations?

I ran into a rather odd behavior that I don't even know how to start describing. I wrote a piece of managed C++ code that makes calls to native methods. A (very) simplified version of the code would look like this (I know it looks like a full native function, just assume there is managed stuff being done all over the place): int somefu...

how to get phyiscal path of windows service using .net?

I have to get the absolute path of a windows service in a .Net Admin application. I am using ServiceController of .Net as shown below. ServiceController serviceController = new ServiceController(serviceName); But I don't see any property here to get the absolute path of the .exe of the service. Is there anyway to get this programmati...

How to convert image file like jpeg or png to svg file in c# .net?

Hi, I want to convert jpg file to svg file in c# .net. ...

.NET: what does "throw;" by itself do?

What would be the point of just having: catch (Exception) { throw; } What does this do? ...

C#: why have all static methods/variables in a non-static class?

I have come across a class which is non-static, but all the methods and variables are static. Eg: public class Class1 { private static string String1 = "one"; private static string String2 = "two"; public static void PrintStrings(string str1, string str2) { ... All the variables are static across all instances...