.net

Simulate ajax loader in winform app

I have a winform app which render a few charts, based on the user selection. I want to simulate an ajax style loader such that when the user makes a selection, there will be an overlay on the form with an animation in the center. What are some of the options in accomplishing this? I was thinking of loading a panel with the animation (gif...

Changing column order in DataTable bound to DataGridView does not reflect in the view

When the application is run, the DataGridView is bound to a DataTable. Later I add more columns to the DataTable programmatically and it is reflected in the underlying data - i.e. the column Ordinals are as they should be. However this is not reflected in the DataGridView. Instead columns are appended onto the originally generated set. ...

Mapping .NET floating point datatypes to Oracle NUMER(P,S) columns.

A .NET application I'm writing needs to store .NET float, double, and decimal datatypes in an Oracle database. When defining a number column type in Oracle, you have to specify the precision and scale of the number: NUMBER(p,s) p is the precision, or the total number of digits. Oracle guarantees the portability of numbers with precis...

Using Linq to get a single column rowset from a stored procedure, How can I clean up this hack job?

I've got a guy who is a wizard at writing stored procs and he can munch 10 tables down to a single column in no time at all. I'm half tempted to invest a couple of days to work with him on returning XML instead of rowsets because I can digest those all day long without any problem. I say that because it is a challenge to get a result of ...

Get AM/PM for a date time in lowercase using only a datetime format

I'm to get a custom DateTime format including the AM/PM designator, but I want the "AM" or "PM" to be lowercase without making the rest of of the characters lowercase. Is this possible using a single format and without using a regex? Here's what I've got right now: item.PostedOn.ToString("dddd, MMMM d, yyyy a\\t h:mmtt") An example ...

C# asp.net gridview bind dropdownlist to List<keyvaluePair<int, string>>

Hi all, OK,... so I have a number of tables in my DB that hold references to an key value pair: types of phone numbers: 1 - Home 2 - Work 3 - Mobile 4 - Fax etc So I have a table for the types and when they are used in other tables they reference the int value as a foreign key. When I have been pulling them out I have been storing...

How do I specify that a list property's contents are xml serialized, but the property itself should not be respresented in the markup?

I've got a class like this: [XmlRoot("channel")] public class Channel { [XmlElement("title")] public String Title { get; set; } [WhatElseGoesHere] [XmlArrayItem("item")] public List<Item> Items { get; set; } } My desired output is this: <channel> <title>The title</title> <item>{item content}</item> <item>{ite...

multiple orderby in this linq code

How do I add a second item to order by with this? I want to order by a goalsScored element too. var theteams = (from teams in xdoc.Descendants("team") orderby (int)teams.Element("points") descending select new Team(teams.Element("teamID").Value, (int)teams.Elem...

Asp.net mvc controls and html helpers

Apparently some vendors (like Telerik) are working on versions of their controls that do not rely on postback behavior to work. As in the latest release of Asp.net MVC RC also code behind files tend to fade away for views, what would the best way for vendors to encapsulate UI rendering (control tags, html helpers) and control behavior...

How to access information entered during setup? (VS2008 setup project)

I added a simple dialog window to the install's UI with textboxes. How do I find out what the user entered? @Mitch Wheat: Thank you. I managed to solve the problem with your help. But I think you failed to mention that I need to use the CustomActionData property of the Custom Action. ...

using asp.net membership provider how to check if the user is registered or not?

using asp.net and c# membership provider how to check if the user is registered or not? I want to handle this in code not by using "login status"? ...

good serial port class for the .net framework?

Does anybody know of a good (hopefully free) class to replace the .net SerialPort class? It is causing me issues and I need one that is slightly more flexible. See my other thread about my issues, but essentially I need to suppress the IOCTL_SERIAL_SET_DTR and IOCTL_SERIAL_CLR_DTR commands from being issued when I open the port, so I n...

ASP.NET MVC Project and the App_Code folder

How come App_Code is not a choices in the Add ASP.NET Folder submenu in the VS solution explorer? I realize you can create one yourself manually by just renaming a New Folder, but what is the rational here? Is this not where you are supposed to put "utility" or "service layer" type classes? On a MVC project side note. I do like the fact...

Are there any constants in the .NET framework for the different web method types (GET, PUT, POST, DELETE, HEAD)?

I just noticed while creating a RESTful WCF service that the Method parameter on the WebInvoke attribute is case sensitive (CAPS required). So, [WebInvoke(Method = "Delete")] is not equal to [WebInvoke(Method = "DELETE")] This mistake was causing a ProtocolException: System.ServiceModel.ProtocolException: The remote server ret...

C# network programming and resource usage

I've been doing a lot of research on how best to write "correct" network code in C#. I've seen a number of examples using the "using" statement of C#, and I think this is a good approach, however i've seen inconsistent use of it with various expressions. For instance, suppose I have some code like this: TcpClient tcpClient = new TcpCl...

Designer page not being refreshed when controls are dropped on the form

(Was: ASP.Net codebehind not finding controls on the web page) I'm using VS 2008. I don't know what secret switch I need to flip, or what trip wire I accidentally tripped over, but the last form I created in my project is misbehaving very seriously: the codebehind is apparently unable to find any of the controls that I have set up on t...

Generics List with Array return but how ?

These Codes really boring. And Tostring() give me error !!! Can you rearrange these codes ? class Program { static void Main(string[] args) { string[] arraystr = { "yusuf", "mehmet" }; Ilist myitems = new Ilist(arraystr); SelectedItemsList slist = new SelectedItemsList(); ...

how to change values in string from 0,00 to 0.00

How can I change values in string from 0,00 to 0.00? - only numeric values, not all chars "," to "." FROM string myInputString = "<?xml version=\"1.0\"?>\n<List xmlns:Table=\"urn:www.navision.com/Formats/Table\"><Row><HostelMST>12,0000</HostelMST><PublicMST>0,0000</PublicMST><TaxiMST>0,0000</TaxiMST><ParkMST>0,0000</ParkMST><RoadMST>0,...

What is needed on the client machine to deploy .NET software?

I am deploying the .Net windows application to client system. Do client need .Net software in his system? ...

How can I hide a directory in C# with a file system driver?

I want to develop a program that can hide a folder. Not a hidden attribute, but a real hiding so that no applications can find it. I think for that I need to create a file system driver. How can I do it in C#? ...