.net

Silverlight DataForm control with RIA ( i.e. Display(Description=....)]

Hi, I want the change the description of the labels on my silverlight dataform which currently show as my table fieldnames (dbEmailAddress). <StackPanel Grid.Row="0" Grid.Column="1"> <dataFormToolkit:DataForm x:Name="dataForm1" CurrentItem="{Binding SelectedItem, ElementName=dgLeagues}"...

What ADO.NET book would you suggest?

For now I know SQL and want to write a database program in C#. I tried to read MSDN but it is too difficult for me. I need a book which can explain how ADO.NET works and give some useful examples. I'm not pro in C# also. P.S. It would be great if the version of ADO.NET explained in this book is 3.5. ...

SQL CE unspecified error

Hello, I did a project with MS SQL Server CE that when installed in the 'costumer' machine just raises an unspecified excpetion. Did some research and looks like I did everything mentioned. The dev env has sql compact 3.5 installed and sql tools for vs 2005. Using dotNet 3.5. But to make it run in de dev machine I need to add the sqlces...

Invalid Operation Exception

I created a WCF Serice that worked fine when hosted on IIS. now, I took the same service, and created a host application in WPF, and when trying to start the service from that application, I get this exception : The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, b...

What font and size is used in Windows 7 File Explorer Tree

I am having a hard time to find out which font is used by the Win 7 File Explorer in the tree view on the left hand side. Better, of course, would be if I can programmatically find out which the right font is (C#). I searched the Windows 7 design guidelines but this particular scenario is not listed (at least I couldn't find it). So an...

Failed to compare two elements in the array

I have a List where T is a class that exposes a "Username" property. Username is of a custom type that encapsulates a string. I implemented the IComparable<T> interface on this custom type that simply returns this.encapsulatedString.CompareTo(other.encapsulatedString) I defined an ICollectionView of the List thus: AllUsers=Collection...

Solid Foundation in programming for windows (Internals)

Hello, I started my windows development with .NET. But I'm a person who doesn't like getting away with work done. I would really like to know how exactly things work, I mean the INTERNALS. I'm doing my Engineering final year. Now and then I encountered few books, If put them in order I think it makes SOLID foundation. So, the list is:...

JIT Optimization of an indexer which is only modified sequentaly

I am curious as to what happens in this situation: int i = 0; MessageBox.Show(i++.ToString ()); MessageBox.Show(i++.ToString ()); Array[i++] = Foo; Assuming this is the only way i is used in the method,does the JIT strip out i and replace it with literal values? ...

Pretending .NET strings are value type

In .NET, strings are immutable and are reference type variables. This often comes as a surprise to newer .NET developers who may mistake them for value type objects due to their behavior. However, other than the practice of using StringBuilder for long concatenation esp. in loops, is there any reason in practice that one needs to know th...

System.Drawing.Point is a value type. Why?

I read that System.Drawing.Point is a value type. I do not understand. Why? ...

Cycling through a SortedList - Why is this faster?

List1 in the following example is a SortedList(Of MyClass) and contains 251 members. The first two codeblocks execute in 15.5 seconds. 1: For cnt As Integer = 1 To 1000000 For Each TempDE In List1 Dim F As String = TempDE.Key TempDE.Value.x1 = 444 Next Next 2: For cnt As Integer = 1 ...

What is a Value Class and what is a reference Class in C#?

What is the definition of a value class and reference class in C#? How does this differ from a value type and reference type? I ask this question because I read this in the MCTS Self-Paced Training Kit (Exam 70-536). Chapter 1, Lesson 1, Lesson review 4 : You need to create a simple class or structure that contains only value t...

Can not get a reference to ConfigurationManager

I simply can not get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here is the code: using System.Configuration; ... x = ConfigurationSettings.AppSettings["MySetting"] // The name 'ConfigurationManager' does not exist in the current context x = System.Configuration.ConfigurationManager.AppSettings["M...

Can .NET Ria service push data from server to client?

Can the .NET RIA Service automatically push data to the silverlight client without the client polling the server at all? I want a feature similiar to wcf duplex polling. ...

Why are delegates null rather than an empty list when there is no subscriber?

Can somebody explain why the .Net framework team decided that a delegate without subscribers should be null instead of an object with an empty InvocationList? I'd like to know the rationale that led to this decision. void DoSomething() { EventHandler handler = SomeEvent; if(handler != null) //why is this null-c...

How can I prevent .NET from using the compiled .config settings when no config file is present?

How can I prevent .NET from using the compiled .config settings when no config file is present? For example, I have a connection string setting in the app.config file that specifies a development server. When built, this produces an .exe.config file. And all is well. However, if you ever forget to tote along the .exe.config file, the...

"A generic error occurred in GDI+" upon Save

I'm trying to "resave" an image and am getting the error "A generic error occurred in GDI+". I've done some searching around this error, however haven't found a solution yet! Most of the suggestions mention: Checking that the stream isn't in use or locked (i.e. File streams) Make sure the stream isn't disposed for the lifetime of the o...

To return a dataset in a web service or not?

Is there a best practice in regards to returning (or NOT returning datasets) from .NET web services? One camp says that we should promote interoperability and use XML schemas to define the web service payload, the other camp says we should return datasets because it's straightforward in Visual Studio and get's the job done more quickly....

Stuck with datagridview and combo box column

I have a typical requirement. I have a datagridview with a combobox column(items loaded at design time). When a user selects an item from combobox, remaining rows gets updated in database based on the selectedItem and dgv gets refreshed. Problem is the combo box will lose its current selection and goes to unselected state. I want to re...

.NET Application that uses Tessnet2 fails

Hi, I have an app that uses Tessnet2. The application fails when I try to call its Init method. The failure is just awful - no exception (ANY), no any trace of error, not even "Send report" window. The app's process is just droped. The problematic code is: Recogniser = new Tesseract(); Recogniser.SetVariable("tessedit_char_whitelist...