.net-2.0

.Net 2.0 application from network share without FullTrust

笑着哭i 提交于 2019-12-22 14:17:04
问题 I am trying to run a .Net 2.0 application from a network share without using the FullTrust permission set. I want to create a new permission set that has just the permissions my assemblies require, and then assign that to the exe on the shared path. Is it possible to do this? From my limited experiments, I find that I am unable to do get any application working from a network share without FullTrust. I tried creating a new perm set, and also tried the Everything and other perm sets, but none

Alternative to SQL BULK INSERT

∥☆過路亽.° 提交于 2019-12-22 12:53:45
问题 I need to import the data form .csv file into the database table (MS SQL Server 2005). SQL BULK INSERT seems like a good option, but the problem is that my DB server is not on the same box as my WEB server. This question describes the same issue, however i don't have any control over my DB server, and can't share any folders on it. I need a way to import my .csv programatically (C#), any ideas? EDIT: this is a part of a website, where user can populate the table with .csv contents, and this

What's the best way to serialize / deserialize a Dictionary<String,String> in .Net 2.0?

雨燕双飞 提交于 2019-12-22 12:52:18
问题 I need to be able to serialize / deserialize a Dictionary to a human-readable (and if it comes down to it, human-editable) string (XML or Json preferably). I only need to work with String dictionaries, not other object types of any kind. The strings, however, are presumed to be free text, so they can have characters like single/double quotes, etc, so they must be encoded/escaped correctly. This project is based on .Net 2.0 so I can't use JSON.Net unfortunately. Any ideas what's the best way

Reference a .net 3.5 assembly in a Script Task in SSIS 2005?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 11:31:53
问题 I've got this to work using a very basic example(outlined below) and I want to see if other SOers have experience doing what I'm attempting...using a 3.5 framework assembly in a Script Task in SSIS 2005. I've basically followed the page found here... except I targeted the 3.5 framework while in Visual Studio 2008. Write/compile your code (targeted the 3.5 framework) Just some simple Linq so that I'm using a greater than 2.0 framework feature using System; using System.Collections.Generic;

How to set an Int16 value to a Nullable<Enum> property using reflection?

一曲冷凌霜 提交于 2019-12-22 08:59:12
问题 I need to do this:- MyClass.cs using System; using System.Collections.Generic; using System.Text; namespace set_property__Enum_To_Nullable_Enum { public enum MyEnum : short { One, Two, Three } public class MyClass { public string MyStringProperty { get; set; } public MyEnum? MyEnumProperty { get; set; } public void ShowAll(string message) { Console.WriteLine(message); Console.WriteLine("String = " + MyStringProperty); Console.WriteLine("Enum = " + MyEnumProperty.Value); } } } Program.cs using

Is there a way to disable .NET browser detection?

二次信任 提交于 2019-12-22 05:36:19
问题 I failed to find a way to disable the browser detection feature added by asp.net 2.0. I want all the request to my page to be treated as if IE is requesting them. My fix was to add an App_Browsers folder to my project and in it have the following .browser file: <browsers> <browser refID="Default"> <capabilities> <capability name="preferredRenderingMime" value="text/html" /> <capability name="preferredRenderingType" value="html32" /> <capability name="requiresFullyQualifiedRedirectUrl" value=

How do I determine which monitor my winform is in?

蹲街弑〆低调 提交于 2019-12-22 03:52:52
问题 I have been up and down this site and found a lot of info on the Screen class and how to count the number of monitors and such but how do I determine which montitor a form is currently in? 回答1: A simpler method than using the bounds is to use the Screen.FromControl() method. This is the same functionality that Windows uses. Screen.FromControl(this) will return the screen object for the screen that contains most of the form that you call it from. 回答2: This should do the trick for you: private

Firing a method in form 1 on click of a button on form2

為{幸葍}努か 提交于 2019-12-21 20:24:24
问题 I am quite new to windows forms. I would like to know if it is possible to fire a method in form 1 on click of a button in form 2? My form 1 has a combobox. My form 2 has a Save button. What I would like to achieve is: When the user clicks on Save in form 2, I need to check if form 1 is open. If it is open, I want to get the instance and call the method that would repopulate the combo on form 1. I would really appreciate if I get some pointers on how I can do work this out. If there any other

C# class from a SQL database table

ε祈祈猫儿з 提交于 2019-12-21 19:19:52
问题 Came across this: http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp And wondering if this is the right solution as I am not that big of a fan of creating a class for every stored procedure or do I use Enterprise Library for ASP.net 2.0 project. 回答1: You definitely shouldn't be creating a class for every stored procedure. There are a number of approaches you can take to handling your database interactions. You should have a good look at the major frameworks out there and