vsts2008

how to check unique collection in C#?

Hello everyone, I am using C# + VSTS2008 + .Net 3.0. I have an input as a string array. And I need to output the unique strings of the array. Any ideas how to implement this efficiently? For example, I have input {"abc", "abcd", "abcd"}, the output I want to be is {"abc", "abcd"}. thanks in avdance, George ...

set session timeout in web.config

Hello everyone, I have tried very hard but cannot find a sample about how to set session timeout value for in-process session for an ASP.Net web application. I am using VSTS 2008 + .Net 3.5 + C#. Here is what I wrote by myself to set timeout to be 1 minute, is it correct? I write under system.web section in web.config, <sessionState ...

Global.asax issue

Hello everyone, I am developing an HttpModule and using Global.asax. I have developed a class which derives from HttpApplication, but Application_Start method of my class never executes (I create a file at the beginning of Application_Start but the file never creates, and it is why I think Application_Start never executes). I am using V...

how to debug ashx file in VSTS?

Hello everyone, I am using VSTS 2008 + .Net + C#. I am developing an ASP.Net web application. I have added an generic handler, i.e. .ashx file. How to debug this ashx file in VSTS 2008? I find there is no view in browser or set as startup page option. Any ideas? thanks in advance, George ...

managing and versioning common libraries across projects

We have quite a few solution in our company. most of them are using a set of common libraries for different functions, (logging, caching, data-access). the question I have is how would you make sure that they are managed properly? Reference the tracing project directly from windows app1 Pros:You don't have to merge and branch. Cons:Y...

issue to get specific XML element value using C#

Hello everyone, Suppose I have the following XML document, how to get the element value for a:name (in my sample, the value is Saturday 100)? My confusion is how to deal with the name space. Thanks. I am using C# and VSTS 2008. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; <s:Body> <PollResponse xmlns="http...

VSTS database schema comparison not saving comments

We use VSTS 2008 with SP1 and GDR R2 installed. Found the next problem: 2 identical databases (for example Database1 and Database2); Database1 is a working database, Database2 is a production one; adding a new stored procedure to the Database1 with comments (description, author etc. before the CREATE PROCEDURE statement); trying to c...

Wrapping Serialized Properties in Additional Elements with .NET XML Serialization

Hello everyone, I am using C# + VSTS2008 + .Net 3.0 to do XML serialization. The code works fine. Here below is my code and current serialized XML results. Now I want to add two additional layers to the output XML file. Here is my expected XML results. Any easy way to do this? I am not sure whether NestingLevel could help to do this. I...

Removing Wrapper Elements from XML-Serialized Array

I am using VSTS2008 + C# + .Net 3.0. I am using below code to serialize XML, and my object contains array type property, but there some additional elements' layer (in my sample, MyInnerObject and MyObject) generated which I want to remove from the generated XML file. Any ideas? Current generated XML file, <?xml version="1.0"?> <MyClass...

Wrapping Serialized Array Elements with the Name of the Array

Hello everyone, I am using VSTS2008 + C# + .Net 3.0. I am using below code to serialize XML, and my object contains array type property, and I want to add an additional elements' layer ("MyInnerObjectProperties" element layer in my expected results below, and I want to make "MyInnerObjectProperties" element as parent element for all My...

Placing a Property into a Different XML Namespace with XML Serialization

I am using VSTS2008 + C# + .Net 3.0. I am using below code to serialize XML, here is my current code and serialized XML file. My purpose is I want to make MyInnerObjectProperties belongs to a special XML namespace (http://foo/2009) and making this namespace as default namespace. Any ideas how to implement this? Current output: <?xml ve...

C# string duplication issue

Hello everyone, I am using VSTS 2008 + C# + .Net 3.0. I have two input strings, I think they are different. But the following C# code thinks they are the same, and throws System.Data.ConstraintException, says Column Name is contrained to be unique, but value already exists. Any ideas what is wrong? Here is my code and my input strings,...

strange WCF client side app.config generated

Hello everyone, I am referring from VSTS2008 (C# console application, using .Net 3.5) by using Add Service Reference function to add reference to a WCF service hosted in IIS 7.0 in another machine in the same LAN. I find the client side app.config generated automatically is very strange. Here is the content, My confusion is the end poi...

Silverlight MediaElement video scale issue

Hello everyone, I am using VSTS2008 + C# to create a Silverlight application based on ASP.Net web application. I only add one line to the default page.xaml to host a local video, Here is the content of XAML, and I want it to scale according to video width/height ratio related to the display area on web page, so I select Stretch="Unifor...

Silverlight deep zoom composing issue

Hello everyone, Deep zoom composer itself is very nice tool. I am wondering if there are any automatic ways to compose? For example, I have 100 images, and I want to compose automatically as 10 * 10 deep zoom effect. I am implementing a background workflow and automatically composing deep zoom and publish. The Output Type I prefer is "I...

very strange string unique issue in C#

Hello everyone, I am using VSTS2008 + C# + .Net 3.0. Here is my code and related exception from ADO.Net. Here is my input two strings in both binary form and text form, any ideas what is wrong? Why the two different strings will be treated as the same by ADO.Net? Exception message: An unhandled exception of type 'System.Data.Constrain...

The type or namespace name 'Objects' does not exist in the namespace 'System.Data'

I am using entities, C# and SQL Server to create an n-tier app. I am creating some base classes common to all my DAL components. In this base class, i want to handle the connection state of the ObjectContext base class inherited by entities object. Compiling throws the following error: The type or namespace name 'Objects' does n...

C# passing ref type parameter issue

Hello everyone, Suppose I have the following code snippets, i.e. goo call foo, DataTable created by goo and foo will only call Rows.Add. Then goo will use the updated data of the DataTable instance from foo. My question is, in my scenario, any differences or benefits compared of using with and using without ref parameter? I am using C...

WCF IIS hosting issue

Hello everyone, I am using VSTS2008 + C# + .Net 3.5 to develop a WCF service hosted in IIS 7.0/6.0. I am learning from the following MSDN link, http://msdn.microsoft.com/en-us/library/ms733766.aspx My question is, suppose I implement the WCF service inside a class library and compiled into some specific DLL assembly. In the service sv...

WCF streaming mode issue

Hello everyone, I am hosting a WCF service in IIS using basicHttpBinding using streaming mode. The WCF web services queries back end SQL Server 2008 by using ADO.Net and return a DataTable to client side of WCF service. My understanding of WCF streaming mode are, WCF streaming mode should use only constant number of memory at both cl...