.net-2.0

Serializable Class

↘锁芯ラ 提交于 2019-12-12 15:01:32
问题 How I can make Student class serializable? I'm reading this article but I do not know what is the right approach if I would implement it in the below scenario. public class Student { private string _studentNumber; private string _lastName; private string _firtName; private List<Subject> _subjects; public Student() { } public string StudentNumber { get { return _studentNumber; } set { _studentNumber = value; } } public string LastName { get { return _lastName; } set { _lastName = value; } }

Active Directory - check if password never expires?

孤街醉人 提交于 2019-12-12 13:26:18
问题 Is there a way in Visual Basic to check if the user's password is set to never expire in Active Directory? I've found a way to find the last date it was changed, but I can't find the other available options. Dim de As DirectoryServices.DirectoryEntry = GetUser(uDetails.username) Dim objUser = GetObject(de.Path) If objUser.PasswordLastChanged < DateTime.Now.AddMonths(-3) Then ... Where can I find a list of all available objUser properties? 回答1: public bool isPasswordExpired(String p_UserName,

Rendering HTML Content within Silverlight application

依然范特西╮ 提交于 2019-12-12 09:53:41
问题 In one of our application it is required to display bullet list in one of the Silverlight 2.0 container. We have decided to use HTML markup text for the same. While there are number of options available on Google like overlaying HTML div container etc., I would like to know what is the most workable way of doing this. 回答1: I think the easiest will be to use some 3-rd party solution. For example, Telerik has an HtmlPlaceholder that allows you to display html pages inside Silverlight

WCF consumed as WebService adds a boolean parameter?

大憨熊 提交于 2019-12-12 08:29:36
问题 I've created the default WCF Service in VS2008. It's called "Service1" public class Service1 : IService1 { public string GetData( int value ) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataContract( CompositeType composite ) { if ( composite.BoolValue ) { composite.StringValue += "Suffix"; } return composite; } } It works fine, the interface is IService1: [ServiceContract] public interface IService1 { [OperationContract] string GetData( int value );

How to compare two numeric values (SByte, Double) stored as Objects in .NET 2.0?

落爺英雄遲暮 提交于 2019-12-12 06:04:56
问题 In my custom sorting algorithm, I need to compare numeric types stored as Objects in an array. We can have SByte, Double, Int32, etc values mixed in one array. How can I compare two values of that array in my IComparer implementation? An example. Let's say we have two numeric values: object var1 = (sbyte)-8; object var2 = (double)123.456; It would be nice if code like the following one worked, but it fails: IComparable cmp1 = var1 as IComparable; IComparable cmp2 = var2 as IComparable;

Transmission Compression from .net to SQL

筅森魡賤 提交于 2019-12-12 05:03:48
问题 I have an win forms App that the users use off line, any they have to sync data using a 3g modem and a cisco VPN, unfortunately the limited band width, poor signal quality and large volume of data transferred is making the sync process unreliable. is there any way to get .net to compress the SQL commands and then having sql decompress and run before sending the results in a compressed reply to reduce the network traffic? 回答1: To create off-line synchronization i recommend to use Service

Why does this code not update the database table?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 03:38:37
问题 In a legacy ASP.NET Webforms app, I need to update a database table when the user clicks a button, depending on which checkboxes on the form are checked, using the value from a corresponding label to make the update. It's not working; however, almost-identical code in a Winforms "test" app does work. The FormLoad (Winforms) and Page_Load (Webforms) code works fine; there is no need to show all of that code; they both populate the form/page with pairs of label/checkbox controls. To show how

Compare two arrays with different dimension

巧了我就是萌 提交于 2019-12-12 02:58:01
问题 I am trying to compare two arrays that always have different dimensions. eg. arr1 -> {1,2,3} and arr2->{1,2} I did try and able to get the matching items to new array. But I am expecting to get the unmatched items only I am expecting to compare both arrays and put only the item '3' to a new array which is in arr1 and not in arr2 eg arr1 -> {1,2,3} and arr2->{1,2} should result a new array with 3 arr1 -> {1,2,3,4} and arr2->{1,2} should result a array with 3,4 Is there any way of doing this

GridView changes not showing in binded datatable

僤鯓⒐⒋嵵緔 提交于 2019-12-12 01:07:34
问题 I have a GridView setup with I've tried to bind to DataTable .. I then make some changes to the GridView's values through the webpage .. Then I go behind the code of a button click, and see that the DataTable still has the old values in it ... ASPX Markup code for the GridView: <asp:gridview ID="ESBAndTSRValuesInputGridView" runat="server" ShowFooter="true" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="Award ID" HeaderText="Award ID" Visible="false" /> <asp:BoundField

Install MVC on 2.0.NET Server with IIS6 without Admin Rights

狂风中的少年 提交于 2019-12-11 23:12:43
问题 On my local machine using IIS 5 (winxp) and visual Web Developer, I've built a beautiful and well composed website using MVC. Now to deploy to the testing server. I find out that it does not have MVC installed - Error:- Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Source Error: Line 39: add assembly="System.Web.Abstractions,Version