.net-2.0

Identical code producing inconsistent image quality on different servers

扶醉桌前 提交于 2019-12-06 02:33:44
问题 Take the following two images: Dev Version - IIS7 Windows 7 Pro 64bit Machine Live Version - IIS7 Windows Server 2008 64bit Machine Note how the Live Version is "pixelly" & looks low quality, the Dev Version however is smooth, anti-aliased & looks fine. These are both generated by identical code: ' Settings Dim MaxHeight As Integer = 140 Dim MaxWidth As Integer = 140 Dim WorkingFolderPath As String = "\\server\share\bla\" Dim AllowedFileExtensions As New ArrayList AllowedFileExtensions.Add("

Get filtered data from dataset to datatable

懵懂的女人 提交于 2019-12-06 01:47:06
问题 How can I filter data from dataset to datatable? like the code-> DataRow[] dr = DS.Tables[0] .Select("STAGENAME='Develop' AND DEVLAPSEDAYS IS NOT NULL"); How can I use datatable here? following code doesn`t reflect changes-> DataTable FilteredDataD = DS.Tables[0]; if (FilteredDataD.Rows.Count > 0) { FilteredDataD.DefaultView.RowFilter = "STAGENAME='Develop' AND DEVLAPSEDAYS IS NOT NULL"; FilteredDataD.DefaultView.ToTable(); } Is is possible to remove a column using above filter,like

How to use Not In datatable.select

依然范特西╮ 提交于 2019-12-06 01:40:04
问题 I have a DataTable (Ado.Net) with column 'Status'. This column holds the values (in each records) ['Red','Green','Blue','Yellow','White','OtherColors'] I want to select all the rows which status value not Red,Green,Blue What the kind of filter expression to use to select data with my proposed criteria. So i want to achive some thing like we used in sql query ( WHERE Status NOT IN ('Red','Green','Blue') NB:This project is running .NET 2.0 i cant use linq 回答1: I have tested it, it works as

Does PostedFile.FileName work differently in .Net 4.0?

青春壹個敷衍的年華 提交于 2019-12-06 00:21:59
I'm working on an ASP.Net site which allows users to link documents using a UNC path. This site is used by a customer of ours for internal processes, so all users on their domain should have access to the UNC path. When a user wants to add a linked document, they select the file using a FileUpload control. Previously in .Net 2.0, the control's PostedFile.FileName property returned the filename and the full UNC path. Now we are using .Net 4.0 and it only returns the filename. Here's my main question: Does PostedFile.FileName work differently in .Net 4.0 compared to 2.0? If not, what else could

c++/cli static constructor of derived class is not called

限于喜欢 提交于 2019-12-05 22:24:22
As described in another SO post of me I saw a strange behaviour of my application after moving from VS 2008 (.net 3.5) to VS 2013 (and using .net 4.0, not 4.5). I found that the static constructor (cctor) of a class was not called any more. Therefore I broke the application down into a small test program: DLLs testAssembly_2-0 and testAssembly_4-0 (similar content; testAssembly_4-0 has names with 40 instead of 20 ) namespace testAssembly_20 { public ref class Class20 { public: Class20 () { Console::WriteLine (__FUNCTION__"()"); } static Class20 () { Console::WriteLine (__FUNCTION__"()" + " ms

ASP.Net word count with a custom validator

巧了我就是萌 提交于 2019-12-05 20:48:05
A requirement for an ASP.Net 2.0 project I'm working on limits a certain field to a max of 10 words (not characters). I'm currently using a CustomValidator control with the following ServerValidate method: Protected Sub TenWordsTextBoxValidator_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles TenWordsTextBoxValidator.ServerValidate '' 10 words args.IsValid = args.Value.Split(" ").Length <= 10 End Sub Does anyone have a more thorough/accurate method of getting a word count? You can use one of the builtin validators with a regex that

Storing string values as constants in the same manner as Enum

有些话、适合烂在心里 提交于 2019-12-05 19:08:52
I know there is a way to make enum work for string types with conversions galore - the code doesn't look pretty. Does anyone know of any way to have something like this: public SOMESTRUCTURE SessionKeys : string { value1 = "value1key", value2 = "value2key", name = "name" } so later in my code I could refer to it as: SessionKeys.value1 This is about the best I've come up with. (I haven't compiled it, so the syntax may be off.) public static class SessionKeys { public const string Value1 = "Value1"; public const string Value2 = "Value2"; ... } Reed Copsey Using C# 2.0 - I believe the best option

New Added Types in .NET Framework 2.0 Service Pack 1

孤街醉人 提交于 2019-12-05 19:04:20
I assumed there were only bug fixes/(no new types) in .NET 2.0 SP1 until I came across few posts which were mentioning DateTimeOffset structure, that was added in .NET 2.0 SP1. Is there a full listing of the newly added types in .NET 2.0 SP1? D2VIANT Here's what you're looking for: Full Article: http://www.hanselman.com/blog/CatchingRedBitsDifferencesInNET20AndNET20SP1.aspx This may also be helpful: Full Article: http://www.hanselman.com/blog/ChangesInTheNETBCLBetween20And35.aspx There were new interfaces added, like INotifyPropertyChanging, so there were new types added. The question is valid

How to set TextBox cursor position without SelectionStart

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 18:53:23
I have a Windows Forms textbox with background thread updating its value every second. If I place cursor inside textbox it will loose its current position at next update. Same thing with text selection. I tried to solve it like that protected void SetTextProgrammatically(string value) { // save current cursor position and selection int start = textBox.SelectionStart; int length = textBox.SelectionLength; // update text textBox.Text = value; // restore cursor position and selection textBox.SelectionStart = start; textBox.SelectionLength = length; } It works good most of the time. Here is

Virtual Database in Memory

断了今生、忘了曾经 提交于 2019-12-05 18:41:17
Imagine the following: I have a table of 57,000 items that i regularly use in my application to figure out things like targeting groups etc. instead of querying the database 300,000 times a day, for a table that hardly ever changes it's data, is there a way to store its information in my application and poll data in memory directly? Or, do I have to create some sort of custom datatype for each row and iterate through testing each row, to check for the results i want? After some googling, the closest thing i could find is in-memory database thank you, - theo SQLite supports in-memory tables.