.net

IsDouble check for string in Vb.net?

I will get data in DataTable. I am going to iterate data in foreach. I will have all types of data in Datatable. Now I need to find Double for each item (string) in DataTable. How to find IsDouble for string? Ex: I have "21342.2121" string. I need to covert this to Double. But sometimes the data will be "TextString". So I can't use Do...

DotNetOpenAuth - What do "Nonce" and "OpenIDAssociation" tables do?

This is a specific question to DotNetOpenAuth. I opened up the .NET template, and found that there are 2 tables "Nonce" and "OpenIDAssociation" and there are 2 SPs that do the cleanup upon on expiration date. What exactly do these 2 tables do? Why do we need to keep track of the association? ...

Closing some instances of an app, increases Gen-2 Garbage Collection Heap?

We're in the middle of debugging some memory issues. We were watch 5 instances of the same app. We stopped 3. The Gen2 Heap size went from about 5M to almost 10M, and the Gen0 and Gen1 heap sizes changed insignificantly. This is the exact opposite of what I'd expect. I expected it to reduce in size, and would never expect it to incre...

How Can I Create a Customized DataGrid View in C# - Winforms Application

Look at the bottom component where GroupBox is Open Work Orders. What components is this? ...

Can two threads of the same process produce the same GUID?

Dear ladies and sirs. If two threads in a process generate a new GUID concurrently using .NET API (Guid.NewGuid()) is it possible that the two GUIDs will be identical? Thanks. UPDATE I want to get practical. I know that it is widely assumed that GUIDs are unique for all practical purposes. I am wondering if I can treat GUIDS produced ...

How can I tell if my method is being called by a different thread than the main UI one?

I pass a data access class (DAL) of my own making into a another class so it can use those data access methods to store data in my sqlite database. This is type-safe because each method that accesses the database creates it's own connection object so calls to the connection object always come from the same thread it was created on. I'd...

Best way to replace XML Text

Hi, I have a web service which returns the following XML: <Validacion> <Es_Valido>NK7+22XrSgJout+ZeCq5IA==</Es_Valido> </Validacion> <Estatus> <Estatus>dqrQ7VtQmNFXmXmWlZTL7A==</Estatus> </Estatus> <Generales> <Nombre>V4wb2/tq9tEHW80tFkS3knO8i4yTpJzh7Jqi9MxpVVE=</Nombre> <Apellido>jXyRpjDQvsnzZz+wsq6b42am...

detect a postback from a radiobutton list

I am trying to detect a postback from Radiobutton list. I am trying to use following code: If Page.Request.Params.Get("__EVENTTARGET") = optDownload.UniqueID.ToString Then But Page.Request.Params.Get("__EVENTTARGET") returns "ctl00$ContentPlaceHolder1$pnlBarAccounts$i0$i2$i0$CHChecking$Acct1$optDownload$4" And optDownload.Uniqu...

How should I provide access to this custom DAL?

I'm writing a custom DAL (VB.NET) for an ordering system project. I'd like to explain how it is coded now, and receive some alternate ideas to make coding against the DAL easier/more readable. The DAL is part of an n-tier (not n-layer) application, where each tier is in it's own assembly/DLL. The DAL consists of several classes that h...

How can I expose a 3rd party's enum through my asmx?

Given: An asmx web service. A 3rd party dll that contains a useful enum. Question: How can I expose this enum through my web service without having to repeat myself and re-type the enum's members in my webservice's public class? ...

c# - clear surface when resizing

Hello, I'm trying to build my own custom control for a windows forms application in C#.Net. Currently I paint some rectangles and other graphic elements using the paint event. When I now resize the app form to fit the desktop size, all elements are repainted (which is exactly the behaviour I need) but the old one's are shown in the back...

OO Design for communication methodology that will change

I am on a project where I will be creating a Web service that will act as a "facade" to several stand alone systems (via APIs) and databases. The web service will be the sole method that a separate web application will use to communicate with these external resources. I know for a fact that the communication methodology of one of the AP...

Stack trace with incorrect line number

Why would a stack trace show "line 0", but only for one frame in the stack trace? eg. ... at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at My.LibraryA.Some.Method():line 16 at My.LibraryB.Some.OtherMethod():line 0 at My.LibraryB.S...

CS0012: The type 'System.Web.Routing.RouteValueDictionary' is defined in an assembly that is not referenced.

I got this error using a new "ASP.NET MVC 2 Empty Web Application" project: CS0012: The type 'System.Web.Routing.RouteValueDictionary' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. ...

What are the guidelines for Parallel.ForEach vs. foreach?

I'm curious about the performance characteristics of Parallel.ForEach. Given any valid construct inside a Parallel.ForEach loop, is it always preferable to use Parallel.ForEach over a foreach loop? I'm specifically wondering about the overhead of invoking the Parallel Tasks library on small sets or other edge cases where a foreach loop...

.Net equivalent of JSP?

What is the .Net equivalent of a JSP page? ...

Current / Context property in class

Hi, I would like to implement an current property in my class which returns the current active context of the class (much like httpcontext.current etc.), like so: using(classA x = new classA(..)) { classB.Dosomething(); } where the method dosomething() gets the current context of classA to perform some operation. How would i go ...

How can I prevent MEF from throwing an exception when an Export is not found?

I have a class with an IList<T> property decorated with the [ImportMany(allowRecomposition = true)] attribute. There are some conditions in which the application might not find any available Exports of the requested type. Right now, it's throwing a CompositionException if no Exports of the requested type are found. I dislike application ...

Process every pair in a sequence

I'm looking for a concise way to process every (unordered) pair of elements in a sequence in .NET. I know I can do it with nested for loops, but I was looking for something a little more readable. I was imagining something like a modified Any() extension method: IEnumerable<Transaction> transactions = ... if (transactions.AnyPair( (fir...

LINQ(2 SQL) Insert Multiple Tables Question

I have 3 tables. A primary EmploymentPlan table with PK GUID EmploymentPlanID and 2 FK's GUID PrevocServicesID & GUID JobDevelopmentServicesID. There are of course other fields, almost exclusively varchar(). Then the 2 secondary tables with the corresponding PK to the primary's FK's. I am trying to write the LINQ INSERT Method and am...