.net-3.5

Translating Where() to sql

Hi. I saw DamienG's article (http://damieng.com/blog/2009/06/24/client-side-properties-and-any-remote-linq-provider) in how to map client properties to sql. i ran throgh this article, and i saw great potential in it. Definitely mapping client properties to SQL is an awesome idea. But i wanted to use this for something a bit more compli...

Anonymous type property setters

Why anonymous types do not have property setters? var a = new { Text = "Hello" }; a.Text = "World"; //error ...

Simple Linq question: How to create query with logic operators

Just began to develop using LINQ, and still can't understand some simple things. So, LinqTable.SingleOrDefault(t=>(t.Field1=="value1")) is equal to SQL "SELECT * FROM LinqTable WHERE Field1="value1" LIMIT 1" How to create (using Linq) the query like "SELECT * FROM LinqTable WHERE Field1="value1" AND Field2="value2" LIMIT 1? ...

.NET DefaultValue attribute

I've heard people say a few different things about the DefaultValue attribute including: "It sets the value of the property before anything else uses it." "It doesn't work for autoproperties." "It's only for decoration. You must manually set actual default values." Which (if any) is right? Does DefaultValue actually set default...

Limit number of Rows that can be entered in a datagridview based on property of DGV

I have a UI that uses datagridviews / bindingsource / datatables of typed dataset for data entry. The dataset itself is serialized to a varbinary(max) in SQL. (i.e. no tableadapter, backend schema) I would like to limit the number of rows the user can enter into some of the grids (the data is used to fill PDF forms and I don't want th...

Attempt to write a read-only database - System.Data.SQLite

Hi guys, I'm having a little bit of a problem that I thought was related to Security but, turns out can't be as I did almost everything ... Plenty of information on this on the web but nothing has an answer to fix the issue. Let me tell my steps: Have a Website on VS2k8 that when I debug or start from Cassini, all works fine When se...

Why do I get an error trying to connect to a Win2k8 MSMQ queue from Windows 7?

I have a .NET3.5 application that connects to a remote queue (a private queue, running on Windows Server 2008). The client recently was forced to upgrade the machine on which this application ran to Windows 7 from Windows XP. Now, when my application attempts to connect to the remote queue it crashes with an error that it cannot connec...

Using an abstract class as the contract in plugin framework...

Can an abstract class be used as the contract object between a 'Host' and a 'plugin'? The idea is that the plugin inherits the contract (we call it an adapter). We are also understanding that all participants in the framework must inherit MarshalByRefObject (MBRO). So, this is what we were thinking - Host: class Host : MarshalByRefObj...

.Net 3.5 DLR DynamicObject Help

I have been struggling to get a simple DynamicObject example working in .NET 3.5. Using the latest build of the DLR off codeplex I haven’t been able to figure out what the .NET 3.5 equivalent to the following is: public class DynamicObjectBag : DynamicObject { private Dictionary<string, object> _properties = new Dictionary<string, ...

What is the maximum memory size allocated for a .NET application?

I was reading an article written by Jeffrey Ricther on garbage collection in MSDN. He mentions that "..If NextObjPtr is beyond the end of the address space region, then the heap is full and a collection must be performed" I would like to know what is this address space region or what is the maximum memory size that CLR allocates to the ...

Displaying byte values in the picturebox control

Hi, i am currently working on a project which deals with the reading of satellite images of ".0FM" format and its size is around 8Mb. Now i have been successful in converting the file("*.0FM") content into a byte array. Now the byte array has integer values ranging from 0 - 255. I have to display this byte array in a picturebox control....

Validate a XDocument against schema without the ValidationEventHandler (for use in a HTTP handler)

Hi everyone, (I am new to Schema validation) Regarding the following method, System.Xml.Schema.Extensions.Validate( ByVal source As System.Xml.Linq.XDocument, ByVal schemas As System.Xml.Schema.XmlSchemaSet, ByVal validationEventHandler As System.Xml.Schema.ValidationEventHandler, ByVal addSchemaInfo As Boolean) I a...

How to tell if you are running in the debugger in VS?

Hi, Is there a way to tell in the code if you are running in the debugger in VS2008? I need to set up a couple things for us developers differently than when the user is running the click one deployed app? I see that there are things you can do to tell if you are in Designer mode but that is not the same. thanks! Bill ...

IIS site always returns 404 to WinMo emulator

I'm running Win7x64 Ultimate with Visual Studio 2008. I have a website built in ASP.NET 3.5 and hosted via IIS on my box. I can run the website perfectly fine and I can hit all of the web services that I have built in the website, using a web browser. When I pull up my Windows Mobile 6 emulator and hit the site (using my IP address) it ...

Windows Service is started but does not do anything - .NET

I have a .NET Windows Service (.NET 3.5) with a timer (System.Timers.Timer). The OnElapsed method looks like this: private void OnTimerElapsed(object source, ElapsedEventArgs e) { lock (this) { timer.Stop(); //process some stuff here.. ProcessStuff(); timer.Interval...

Unable to start debugging on the web server. The COM+ registry database detected a system error

I'm trying to debug an ASP.NET webapp that's configured to "Use Local IIS Web Server" on WinXP. When I start the debugger, the compile succeeds, and then the following error is displayed in a dialog: Unable to start debugging on the web server. The COM+ registry database detected a system error The webapp never launches in my ...

Access the StackTrace when deploying in Release mode

I'm not entirely sure if the StackTrace does not work correctly when deploying in release mode, however, we want to log all the exceptions so we can make bug tracking easier when deploying, and of course, deploying in debug mode is not an option. The info we need from the StackTrace class is the file name, the method, and the line number...

How to add a new row to a datagrid(WPF toolkit) when click on a button in the outside of datagrid

I want to add a new row in the datagrid when click on a button in the outside of a datagrid. The datagrid is bound with SQL Server database, and it have some data at runtime I want to add new data to the database through the database I tried a lot, but it was unsuccessful Anyone reply me it will be very helpful for me... Advance thank...

How to manipulate Html.ActionLink to show a link to another controller?

In the Details view of the HomeController, I'd like to create a link to the Email view on the MiscController. In addition, I need to add an item to the QueryString. I'd like to create a link that goes something like: <a href="http://www.blah.com/misc/SendMail?id=6"&gt; <font size="1">Report problems</font> </a> I've tried the ...

Tcp Reliability versus Udp Burdens for serious, high-performance server

Speed, optimization, and scalability are the typical comparisons between the Udp and Tcp protocols. Tcp touts reliability with the disadvantage of a little extra overhead, but speed is good to excellent. Once a Tcp socket is instanced, keeping the socket open requires some overhead. But compared to the oft described burdens of Udp, which...