vb.net

How can I display an organized hierarchical data in asp.net 3.5?

Hi, I am working on a project that organizes the structure and hierarchy of departments. I want to view and display the whole structure of the organization visually, but I am stuck. I wanted to know what is the best way to do it in ASP.net 3.5; my goal is to achieve something like this by code and each node is linkable and can have CSS. ...

.NET Team - Best Practices and Methods

Hi, What best practices and methods would you enforce on a new .NET development team? Cheers ...

Formatting values for CSV File in vb.net

Hello Exeperts, I am creating a csv file from my vb.net application as shown below Dim csvFile As String = My.Application.Info.DirectoryPath & "\Test.csv" Dim outFile As IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(csvFile, False) outFile.WriteLine("Column 1, Column 2, Column 3") outFile.WriteLin...

What are the different methods for injecting cross-cutting concerns?

What are the different methods for injecting cross-cutting concerns into a class so that I can minimize the coupling of the classes involved while keeping the code testable (TDD or otherwise)? For example, consider if I have a class that requires both logging functionality and centralized exception management. Should I use DIP and injec...

StringCollection or ArrayList within Class

Hi there, I have a class called CookieMonster, its objective is to simply create a cookie based on 3 parameters passed to it. The cookie name, the cookie name-value pairs and the cookie expiry date. I have experimented with List(of T) and Array and StringCollection, but I'm unsure which is the best for passing the name-value pairs and ...

Order By file date in collection

I don't think the, System.Collections.ObjectModel has any sort or order by capability. I have a list of files and I'd like to sort by the file date. Dim list AS System.Collections.ObjectModel.ReadOnlyCollection(Of String) list = My.Computer.FileSystem.GetFiles("C:\SearchFolder" _ , FileIO.SearchOption.SearchByTopLevelOnly _ ,...

What is a predicate in c# ?

I am very new to predicate. just learned how to write a predicate like Predicate<int> pre = delegate(int a){ a %2 == 0 }; what will the predicate return ? and how is it useful when programing ? ...

Finding the date of monday in a week with VB.NET

I need to find a way to find the date (DD/MM/YYYY) of the Monday for any week we're on. For example, for this week, monday would be 09/11/2009, and if this were next week it'd be 16/11/2009. I managed to get somewhere in the forms of code, but all I got was 'cannot convert to Integer' errors. I was using Date.Today and AddDays(). Than...

VB.Net User Controls not working in Live

Hi All, At work we have a pretty large web application that works by having a few pages, with lots of user controls which are nested in these pages. This is working fine most of the time but we have a problem at the moment where one of the user controls isnt working. Originally it was referenced from another project in the solution but ...

How to determine why a distributed transaction is timing out

I am using LINQ to SQL and a third party SDK that supports distributed transactions. When I realize that a pending update will be updating both SQL records and records in the third party SDK, I am creating a TransactionScope with a 0 (presumably infinite) timeout (although I've also tried 12 hours as a timespan parameter). Then I use G...

Is it possible to override the auto-indentation of comments in VB.NET/VS2008?

Is it possible to override the auto-indentation of comments in VB.NET (Using visual studio 2008)? Please see the comment above the second Case Statement in the code below for context. The IDE auto-indents the comment beyond the following Case Statement. I would like to override this behavior and bring it in line with the C in Case that...

Limitless String in .net

This is a question that has been bugging me for a while and I am no longer working in this so sorry for the lack of code. The situation is this I had a web service that in the client and the server page it had compression and it had encryption. It didn't work all the time because there was accents and that crashed the encryption but when...

ASP.NET page change causes an object array in Session to be unable to cast to it's own type??

I am storing an array of a custom serializable class in session on my site. When a page on the site changes, suddenly it renders them invalid, and tells me that it can't cast the type to it's own type. I assume the class version numbers are changing or something?! I'd appreciate avoiding the "don't use session" answers, unless it's a ...

when to use or not Lambda Expressions.

I see lambda expressions have become a very useful tool at some points in the language. I've been using them a lot and most of the time they fit really nice and make the code shorter and perhaps clearer. Now.. I've seen some , I would say excessive use of them. Some people like them so much that try to use them everywhere they can.. Som...

Which is faster - if..else or Select..case?

I have three condition to compare. Which one is more faster between the following two? Please point me out. Thanks all! If var = 1 then Command for updating database ElseIf var = 2 then Command for updating database ElseIf var = 3 then Command for updating database EndIf and Select Case var Case 1 Command for up...

Winform Textbox CanGrow ?

I don't find a CanGrow property on the Textbox control. This is common in some other controls, and what it does is expand the control to acomodate more data. Anyway to get this feature in the TextBox? ...

asp.net App_LocalResources folder.

I would like to have App_LocalResources folder outside web application folder, so that I could deploy updated resx files and web app. independent of each other. Reasons: We do not want to change current deploy tool. Any way to achieve this? ...

Suspend System Shutdown for a period of time in C#/VB.net

Hi all, I have created a windows service in C# .net and now I want it to alert me if its going to shutdown. For this I make use of Dispose/Unload events but now I want if the services are stopping due to system shutdown process it will alert me. So is there any way to get access to system shutdown event and execute the set of commands ...

while in vb to make a read from stream reader

Dim line As String Using readFile As New StreamReader(SalesUpdateFile) While (line = readFile.ReadLine) IsNot Nothing i am new to vb and everytime i run this code it gives me this error "IS" requires an operand that have a refrence type any help will be highly apperciated thnx ...

WIX 3.0 Generate Features from .NET projects.

I have a large .NET source tree (185 C# and VB projects, of which 60 are apps or websites) that i want to create a wix setup for. The general idea is to have 1 setup msi and to make each executable a feature, and to have each app be installed in a separate directory. like %progfiles%/company/app1 /app2 ...