.net-2.0

Strange SQL Server type conversion issue

有些话、适合烂在心里 提交于 2019-12-11 12:39:17
问题 I've experienced today strange issue. One of my projects is running .NET + SQL Server 2005 Express. There is one query I use for some filtering. SELECT * FROM [myTable] where UI = 2011040773395012950010370 GO SELECT * FROM [myTable] where UI = '2011040773395012950010370' GO UI column is nvarchar(256) and UI value passed to filter is always 25 digits. On my DEV environment - both queries return same row and no errors. However at my customers, after few months of running fine, first version

change color of DataGrid row

橙三吉。 提交于 2019-12-11 12:18:42
问题 I want to color entire rows of a System.Windows.Forms.DataGrid based on the content of one cell of the Row. I couldn't find any way to do that, since there is no .Rows -Property of the DataGrid or a .Row -Property of the DataGridTextBoxColumn (or any similar). Searching for solutions in the internet also didn't help me so far. Switching to DataGridView is unfortunately not an option. So the question remains: How can I change the color of a DataGrid row? 回答1: Thanks to this link (provided by

Using RegSetKeySecurity to avoid registry redirection

偶尔善良 提交于 2019-12-11 10:33:22
问题 In order to avoid registry redirection to Wow64 keys, how to translate the following code that uses Microsoft.Win32 APIs public void SetKeyAccessControl( RegistryKey rootKey, string subKeyName, string identity, RegistryRights rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType accessType) { using (RegistryKey regKey = rootKey.OpenSubKey(subKeyName, true)) { RegistrySecurity acl = new RegistrySecurity(); RegistryAccessRule rule = new

How do you do an assignment of a delegate to a delegate in .NET 2.0

非 Y 不嫁゛ 提交于 2019-12-11 10:14:26
问题 I just go the answer on how to pass a generic delegate as a parameter. Thanks for the help. Now I need to know how to ASSIGN the delegate to another delegate declarartion. Can this be done? Public Class MyClass Public Delegate Function Getter(Of TResult)() As TResult ''#the following code works. Public Shared Sub MyMethod(Of TResult)(ByVal g As Getter(Of TResult)) ''# I want to assign Getter = g ''#how do you do it. End Sub End Class Notice that Getter is now private. How can I ASSIGN Getter

ASMX web service Enum not retaining its value

*爱你&永不变心* 提交于 2019-12-11 09:27:29
问题 I have created a web service containing an enum with values as follows public enum DesignChoice { DesignerChoice = 1, CustomerChoice = 2, AdditionalDesign=3, } When I add a reference to my client website, enum values are changed as in the following code: (int)DesignChoice.AdditionalDesign returns 2 but I am expecting it to be 3. I have tried the serialization attributes [System.Xml.Serialization.XmlTypeAttribute()] out of nowhere but had no luck. WSDL of the service describes the enum as

Wix 'undefined preprocessor variable'

♀尐吖头ヾ 提交于 2019-12-11 09:05:40
问题 I have seen questions like this, but they seem to not help me. I am playing with a test web application. I added this into my RStp.wixproj, I had a hard time, but it works, it generates the Frags.wxs: <Target Name="BeforeBuild"> <Exec Command=" "$(WiX)bin\heat.exe" project "..\WebR\WebR.csproj" -cg Portals.Vendor -gg -pog Binaries -pog Content –configuration "release" -platform "AnyCPU" –out "Frags.wxs" " /> <ItemGroup> <Compile Include="Frags.wxs" /> </ItemGroup> </Target> My Frags.wxs looks

Hide a tablerow in a .NET rdlc report if the field represented in the row is empty? [duplicate]

守給你的承諾、 提交于 2019-12-11 08:46:52
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to collapse a row in RDLC rather than just hide it? I see the tablerow.Visibility property and another property called 'ToggleItem' but am not sure how to make this work. I want to hide the tablerow dynamically if it's only text field (in this case a user comment field) is empty. 'CanShrink' doesn't seem to do the job. The tablerow is .25 inches high and it takes up this much space even if there is no data

What is the simplest way to parse an expression and retrieve a parse tree?

吃可爱长大的小学妹 提交于 2019-12-11 08:31:33
问题 I just want to parse simple expressions like - IIF(FVAL(PFC) = TRUE, (IIF((ORGVAL(BAS, "2012/12/31") + ORGVAL(DA)) < 6500, (FVAL(BAS) + FVAL(DA)) * 12%, 780)), 0)` After parsing this I should be able to know what functions contains what parameters. |-FVAL |-PFC |-ORGVAL |-BAS |-"2012/12/31" I'm stuck with .Net Framework 2.0, so no Linq or lambda expression goodies for me. Also I want to include the code in my custom library and not just reference it. Can anyone point me to some good library

Bind Datagridview to StringCollection

泪湿孤枕 提交于 2019-12-11 08:19:44
问题 Is it possible to bind Datagridview to StringCollection ? I tried to do it in a manner StringCollection dict = Settings.Default.MyDict; BindingSource bs = new BindingSource(); bs.DataSource = dict; this.DGV.DataSource = bs; Bud instead of items of the collection datagridview shows lengths of the items. 回答1: The problem is that when it binds to StringCollection , the underlying type is string so it pulls out the first property that it finds from type string to display. That property is Length.

RegAsm dll .net2.0 to .net4.0

﹥>﹥吖頭↗ 提交于 2019-12-11 08:19:09
问题 I have a dll that registers fine using .Net2.0's regasm, but when attempting to register with a .NET4.0 regasm, I get the error "Could not load file or assembly ' FILENAMEHERE ' or one of it's dependencies. Operation is not supported. (Exception from HRESULT: 0x8013515 Code and assembly are below STARTelnet.cs /** *Steven T. Norris Created: 3/27/2012 *Last Updated By: Steven T. Norris Last Updated On: 3/27/2012 * */ using System; using MinimalisticTelnet; using System.Net.Sockets; /** *