.net-3.5

WCF consumed as WebService adds a boolean parameter?

I've created the default WCF Service in VS2008. It's called "Service1" public class Service1 : IService1 { public string GetData( int value ) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataContract( CompositeType composite ) { if ( composite.BoolValue ) ...

Can I get the T-SQL query generated from a LinqDataSource?

I´m using the LinqDataSource to populate a grid. But now I need the SQL query that the LinqDataSource generates, to pass around throught methods (no, I can't modify the methods to not need a SQL query). Is there a way to obtain the generated SQL query from a instantiated and configured LinqDataSource? ...

Which Oracle Client and ODP.NET version should I install (using .NET 3.5)

After quite some time developing with Oracle Client 9.2.0.7, and the ODP.NET to go with it, targeting .NET 1.1, we are upgrading our code line to .NET 3.5 and we are also considering upgrading the Oracle Client version. I wonder if there are any "gotchas" as to whether specific versions should be used/not used? For example Oracle Clien...

Visual Studio isn't generating code to instantiate instance of custom control

I've created a custom control using C#, .Net3.5, and Visual Studio 2008. I'm then adding that control to another control by dragging it from the toolbox. After doing this when I try to compile I get an error as follows: Error 1 Warning as Error: Field 'MyNamespace.MyControl._myCustomControl' is never assigned to, and will always hav...

Listing down .netassembly names

How many assembles do we have in .NET 3.5? Can I list them down For eg: System; System.Windows.Forms and so on...Please help with code in C# ...

Html.AntiForgeryToken() causeing errors after upgrading to .NET 3.5 SP1

I've just updated to .NET 3.5 SP1 and my once working ASP.NET MVC page has now stopped working. When trying to load a page I get the following YSOD [CryptographicException: Padding is invalid and cannot be removed.] System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCo...

nullable var using implicit typing in c#?

Is there anyway to have the var be of a nullable type? This implicitly types i as an int, but what if I want a nullable int? var i = 0; Why not support this: var? i = 0; ...

MDI Form detecting with a child form is added or removed

Is there an event I can use to tell if a child form has been added or removed from the MDI parent? ...

MSSQL Date Functions

When I add this to my where clause: DueDate <= getDate() AND DueDate IS NOT null I get a nice little failure that says: Could not create child: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.EvaluateException: The expression contains undefined function call getDa...

Preventing Edits to specific rows in DataGridView

I want to prevent the user from editing or deleting the first three rows of a datagridview. How can I do this? ...

Installing .Net 3.5 SP1 framework company wide

We really want to start pushing-out products using the 3.5 framework but it is a pain having to install the framework on every PC. We can get the app to do and automatic update on first run but that takes forever. Is there any way to force all the PC's to update overnight? e.g. via Windows Update... Our PCs are a mix of XP and Vista ...

Grouping data with Linq or not possibe?

I have a List of concrete objects. Some require to be analyzed to take a decision to which one will be kept (when the group contain more than 1 occurence). Here is a simplified example: List<MyObject> arrayObject = new List<MyObject>(); arrayObject.Add(new MyObject { Id = 1, Name = "Test1", Category = "Cat1"}); arrayObject.Add(new M...

Custom Class for dealing with embedding in Forms

I have a custom class file in C# that I inherited and partially extended. I am trying to re factor it now as I have just enough knowhow to know that with something like generics(I think) I could greatly condense this class. As an inexperienced solo dev I would greatly appreciate any direction or constructive critism any can provide. ...

Looking for a clear, concise guide to the exams required for the MCPD: Enterprise App Developer on .NET 3.5

I've searched and didn't find much on the topic, and I'm certain some others will have this question... So I'll ask! I'm looking for a clear and concise guide as to what exams are required for the MCPD: Enterprise Application Developer (.Net 3.5) certification from Microsoft. I've found a lot of information, especially from Microsoft, ...

DataTable to Json using jquery

I'm trying to execute a web service which returns a DataTable with the following piece of code: $.ajax({ type: "POST", url: url, data: data, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { //do things } }); If the webservice retur...

Fixed Length numeric hash code from variable length string in c#

I need to store fixed-length (up to 8 digits) numbers produced from a variable length strings. The hash need not be unique. It just needs to change when input string changes. Is there a hash function in .Net that does this? Thanks Kishore. ...

Can I use ASP.NET AJAX History without having .NET 3.5 SP1 installed?

Is it possible to use this feature on a server that only have .NET 2.0 installed? After an initial look into how AJAX history is implemented, I'm not sure it would be easy. I am just curious if anyone knows of a way to do it. ...

WPF and Layers

Hello all, I am trying to learn WPF and so far I love it. However, there is something missing or simply something that I don't understand. How can we display multiple layers of controls in WPF? Attached, the screenshot gives a good idea of what I am trying to do. I have a window and I want to display something else on top of it. How can...

How to use an enumeration in an XNA ContentReader?

For instance, I was thinking of replacing this: var.StringAttribute = input.ReadString(); With something like this: var.EnumAttribute = input.ReadExternalReference<EnumName>(); However this doesn't work quite right. And ideas on how to get input to read a custom enumeration? ...

Why am I getting a System.Security.Permissions.SecurityPermission error in my .NET Application?

I am trying to develop a text-to-speech editor in .NET 3.5 using C#. I encountered the following exception: System.Security.Permissions.SecurityPermission. How to handle it? ...