.net

How to idenfiy if the DLL is Debug or Release build (in .NET)

I'm sure this has been asked before, but google and SO search failed me. How can I identify if a DLL is a release build or debug build? ...

Smart Client and Web App simultaneous development

What are the strategies and tools to be used, if an Application that is being developed needs to have Web Client and Smart client. Does Smart Client Software Factory or related applications blocks ease such developmental path? The environment is .Net 3.5 Please suggest me the direction based on these priorities 1. Reuse of code 2. Devel...

.NET Reflection Create Class Properties

Hi, I am fairly new to reflection and I would like to know, if possible, how to create an instance of a class then add properties to the class, set those properties, then read them later. I don't have any code as i don't even know how to start going about this. C# or VB is fine. Thank You EDIT: (to elaborate) My system has a dynamic ...

c# regular expression problem

I have this regular expression that extracts meta tags from HTML documents but it gives me errors while I incorporate it in my web application. the expression is @"<meta[\\s]+[^>]*?name[\\s]?=[\\s\"\']+(.*?)[\\s\"\']+content[\\s]?=[\\s\"\']+(.*?)[\"\']+.*?>" ; is there anything wrong with it? ...

How to determine if a string is a valid IPv4 or IPv6 address in C#?

I know regex is dangerous for validating IP addresses because of the different forms an IP address can take. I've seen similar questions for C and C++, and those were resolved with a function that doesn't exist in C# inet_ntop() The .NET solutions I've found only handle the standard "ddd.ddd.ddd.ddd" form. Any suggestions? ...

Underscores for private local variables?

It seems to be the case with the BCL to use underscores for private local variables. I never use them, but get away like this: int count = 0; this.Count++; public int Count ... public ClassName ( int count ) { this.Count = count; } What are your thoughts on this? Are they are problems with my approach? ...

Is there any way for an ASP.NET webservice method to use async methods?

I have an ASP.NET webservice (.asmx) with a simple method that reads something from the DB with a sync call (ExecuteReader) and returns the result. There is any way to optimize the Thread Pool usage (ie. by calling an async call (BeginExecuteReader)) without changing the method's signature? The intention is to not block a thread pool th...

Any way to shorten or simplify the item template markup for a repeater control?

Is there a way to shorten the markup for this repeater? I am binding a DataTable to this repeater. It bothers me because ((System.Data.DataRowView)Container.DataItem) is repetitive and makes the markup less readable especially when you have more fields. I am using .Net 3.5 C# WebForms. MVC is not an option. Thanks. <asp:Repeater ID...

IronPython - JSON choices

What is the best way to deal with JSON in IronPython 2.0.1. The native Python "standard library" json looks to be not implemented yet. If I wanted to use the Newtonsoft Json.NET library how do I do this? I could add the assembly to the GAC, but what are my other choices? ...

Insert a <br /> tag programmatically (VB.NET)

I'm trying to dynamically add results to this display and I simply want to put a break tag after a label to start putting information on the next line. For some reason, Using a literal isn't working for me. Is there a better way to do this or should I just use tables? Dim break As LiteralControl break = New LiteralControl("<br />") di...

When is it Appropriate to use Generics Versus Inheritance?

What are the situations and their associated benefits of using Generics over Inheritance and vice-versa, and how should they be best combined? Thanks for the answer guys. I'm going to try to state the motivation for this question as best I can: I have a class as shown below: class InformationReturn<T> where T : Info { InformationR...

Web Deployment Projects tool in VS 2008

Hello, When we install Web Deployment Projects tool, we also have an option to use it inside VS 2008. By selecting Property Pages we are presented with several options for configuring compilation options.One of Property Pages dialog boxed is named Output Assemblies. It presents us with the following options: * Merge all outputs to ...

SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE()

I'd like to avoid having many checks like the following in my code: myObj.someStringField = rdr.IsDBNull(someOrdinal) ? string.Empty : rdr.GetString(someOrdinal); I figured I could just have my query take care of the nulls by doing something like this: SELECT myField1, [isnull](myField1, '') FROM myTable1 WHERE myField1 = someCondit...

I've read that assemblies manually placed inside Bin are also automatically referenced by...

Hello, Q1 We can add assembly reference to a web project via Website --> Add Reference , and assembly will automatically be referenced by all pages in that web project. But I’ve read somewhere that even if we simply copy ( thus we don’t add it via Website --> Add Reference ) an assembly to the Bin directory of a web project, that i...

What is a realistic measurement to load test a CMS web application?

Our company is facing some difficulties with our CMS web application. This application was part-built by a contractor and we have been confronting some stability issues (crashing, having to put them in front of load balancers or caching mechanisms) when we think the application should be able to handle it. We put together a minimal sta...

LLBL: Delete Where NOT IN

I'm trying to perform the following query in LLBL and I'm not having much luck. DELETE FROM dbo.MyTable WHERE MyTableId NOT IN ('39', '43', '44') Essentially, I'm up to this point: private static void Delete(MyTableCollection newRecs) { PredicateExpression filter = new PredicateExpression(); MyTableCollection allRecords = new...

ListView ItemChecked event

I have a ListView where each item has a checkbox. Initially there are no events attached and I set the state of the checkboxes programatically. After this I attach an ItemCheckedEventHandler and the event handler fires for each of the events that occurred before the handler was attached. Is there a way that I can clear the event queue...

ASP.Net FindControl is not working - How come?

I have used FindControl in the past, prior to .NET 2.0/3.0. It seems like now, for some reason, the ID's of my controls get a funky named assigned. For example I assigned an id "cbSelect" to a checkbox, but FindControl does not find it. When I view the HTML it was assigned ctl00_bodyPlaceHolder_ctl02_cbSelect. I have not found one ex...

Page moves to top on postback of control in updatepanel

I have an update panel on my page and anytime I have a control postback in it, the page scrolls back up to the top of the page. Why would this happen? How can I fix this? ...

Write to a CD from .Net

Is there an easy way to write to a CD from .Net? How about creating a multisession CD that autoruns an executable that writes to itself? ...