.net-2.0

Win7 UAC problems when running application designed for WinXP

Application2 was orginally developed an application for WinXP. Now I have to contend with User Account Control (UAC) on Win7. The Application2 runs fine on Win7 as long as the user is logged into an Administrator account and they select "Run as administrator." However, I am trying to evaluate whether it is possible to refractor Applic...

Remove array items with Array.FindAll

How can I remove an item in an array? This is what I have, which is not OK. // fr_watchdog.items = public array string numToRemove = "test"; fr_watchdog.items = Array.FindAll(fr_watchdog.items, val => val != numToRemove).ToArray(); All done. I have found a solution for this problem (listed below). Is...

What is meant by Compile-time typesafety here?

In the chapter Generics CLR Via C# v3, Jeffrey Richter says below TypeList<T> has two advantages Compile-time type safety boxing value types over List<Object>, but how is the Compile-time type safety is achieved? //A single instance of TypeList could hold different types. using System; using System.Collections.Generic; using System....

How to get Environment.SpecialFolders.MyVideo folder in .NET 2.0?

Can anyone tell me how to get the Environment.SpecialFolders.MyVideo folder in .NET 2.0? In .NET 4.0, the MyVideo folder is listed in the enum Environment.SpecialFolders, but under .NET 2.0 it is not existant. Which way would you go if you had to find that folder under .NET 2.0 with different Windows localisations and OS versions? ...

Decoding Garmin ADM files

Hello, DOes anyone have any experience decoding Garmin's ADM file type? It's used by their MapSource software for creating content and putting it on one of the devices, however i'm attempting to create a standalone reader for such files. Does anyone have experience with this sort of thing? Thanks, brian ...

Only last line of the Exception stack trace shows up

Hi all, I am having some trouble collecting information on an unhandled exception being generated (very rarely) in my code. I have set up an the handler pretty much the standard way. In the main I have: AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionProcessor); And the handler function is: ...

Returning a user friendly error message to client, from a web service

I need to return an error message to the client, if they have entered invalid data when calling my web service. So if my code is: If Not IsNumeric(strOrderID) Then Throw New SoapException("Invalid Order ID", SoapException.ClientFaultCode) End If I get a web page saying: System.Web.Services.Protocols.SoapException: Invalid Or...

Creating a namespace to "import" a database class in vb.net 2005

I need to create a namespace for my database class file, so I can call the database procedures within my webservice module. How can I create a namespace to call that Db class file? ...

Class 'clsGetHeaderValue' cannot be indexed because it has no default property.

I am getting a strange error when I try to build my solution. The error occurs when I am calling the oGetHeaderValue function and passing the parameters. Dim oGetHeaderValue As New clsGetHeaderValue Dim returnString As String returnString = oGetHeaderValue(strInvoiceNumber, strOrderNumber) The error message is: Class 'clsGetHeaderV...

A simple VB.net SQL data query that is not returning any records

I am trying to debug my code, which involves a simple webservice that passes parameters to a data class, which calls a stored proc, and returns one row of record. I am not getting any error messages, but I am not getting any records back either. My webservice code is: <WebMethod()> _ Public Function GetDataValues(ByVal AutoVIN As Str...

c# DateTime Add Property without extension Method

I am writing a class library where i need to extend System.DateTime to have a property called VendorSpecificDay such that DateTime txnDate = DateTime.Today; VendorSpecificDayEnum vendorDay = txnDate.VendorSpecificDay; public enum VendorSpecificDayEnum { Monday, Tuesday, ShoppingDay, HolidayDay } I realize that this is a perfe...

Network Services Account

HI All, I have a .NET application which connects to a Web Service. Application pool for the Web service works under Network Services account. Everything was working fine till yesterday and somehow it started giving error today. When I changed the application pool account from Network Services to an Admin level account, everything starte...

Converting SQLDataReader to String in VB.Net

I am returning one row from the database, and I want to convert the SQLDataReader to a string format, so I can pass it to my webservice. Dim rdr As SqlDataReader = sqlcmd.ExecuteReader If rdr.HasRows Then rdr.Read() GetInvHeaderValue = Convert.ToString(rdr.Read()) Return GetInvHeade...

Issue with returning records back to a web service

I am having some issues in attempting to display a recordset from my webservice. Currently my application involves a client feeding their values into my webservice. The webservice will then call a vb.net database class, which executes a SQL stored procedure, returns a recordset to the database class, and the class will pass the record...

How to call WCF service from .NET class library

I have a WCF web service built in .NET 4.0 that is configured to require a username/password on each call and uses a Server certificate in the behaviour to encrypt the request. It currently uses wsHttpBinding. I have a .NET 4 utility app that lets me call the methods on this WCF web service just fine. I need to call this service from a ...