public void UpdatePlayer(int id) { Player player = new Player() {ID = id}; player.Password = "12"; Entities.Players.Attach(player); Entities.SaveChanges(); }
I'm trying to get my decimals to display with four decimal places. The DB rounds my number to 4 decimal places, but it returns the number with trailing 0s (due to the decimal precision of the field), so something like 9.45670000. Then, when I do this:
string.Format("{0:#,#.####}", decimalValue);
The output I get on the page is 9.4567, which is what I want.
However, if the number returned from DB is 9.45600000, the output after doing the format is 9.456
But what I need to display is 9.4560
How do I format my decimal, so that the number of decimal places is always four?
UPDATE: Also, is it possible to use a variable (instead of .0000) if I wanted the number of decimal places to be determined dynamically?
i want to round the corner of top and bottom of asp.net menu.i have done this by adding chiditem with blank name and set image but its not showing properly on all major browser.
If I disable javascript and cookies, [URL] detects that cookies are disabled without a redirect. If you click the cart link, there's only a get on the cart page.
I'm guessing [URL] is most likely not using ASP.NET, but how would you accomplish detecting disabled cookies using ASP.NET without the use of javascript and redirecting? Is it possible to detect if cookies are disabled in one round trip?
I am creating a search results page in C# in an ASP.NET 1.1 page. In my data layer I have a DataSet that stores the result of a plain old ADO.NET stored procedure call. The DataSet has two DataTables and I'm using a DataVIew to filter and sort the columns.
I only want to fill the dataset once, and then work on the DataTables and derived DataView until the page is unloaded. How best should I cache the DataSet in my DAL so that it is filled only PageLoad? Do i put it in a Cache object, a static member variable, a property...
Why does Application_AuthenticateRequest make so many round trips before actually loading a page. I've noticed that at times it will process the same logic 10 or more times before actually loading a single page?
I don't understand why this is happening, and it makes me worry about excessive & unnecessary performance loads.
I make a panel rund corner using Ajaxtoolkit roundcorner. It works fine Now I use CSS file with this panel but roun corner do not work. Is it possible make Ajaxtoolkit working with CSS?
I have a column in gridview which displays float values. But while the same value in chart I need to round off to nearest whole number and display it in chart.
I'm looking at ways to reduce the quantity of Round Trips to my site for my clients. Right now I have several images that I think should be combined into a single image like this:
[URL]
and then spit out some CSS like this:
[URL]
... that way I can reduce the round trips and increase the speed in which my site is used (after the first load). Is there any simple tool that will do this for me? I figure it's 2010 and someone somewhere automated this. I have Visual Studio, and Expression Web and don't see it there
I want to change the look of the header of the web parts to have a round-at-corners and gradient look (three images GradientLeft,GradientMiddle,GradientRight)?What's the best way to do this? Do i have to create an entire custom web part chrome just for that?One relevant blog that i found in the internet( http://live.mscommunity.net/blogs/borissevo/archive/2007/10/04/rounded-corners-for-web-parts-in-asp-net-2-0.aspx) doesn't have gradient in the middle and doesn't really work good anyway either
Basically I am using a ModalPopUpExtender and it works fine, except that the OK button has an OnClick event that only fires when it is clicked for the 2nd time.. obviously i can progress with populating my OnClick event method for later on - its just annoying that a user has to click my button then ok in the pop up twice before they can get their intended result!
I need to style the asp:Menu so the navigation buttons have rounded corners.
I have a javascript-based navigation menu (not asp.net) that uses images to simulate rounded corner navigation. However, I think I have to use an asp:Menu for my asp.net 4 website instead of a static page navigation menu.
I also plan to use Dynamic Data on multiple tabbed pages.
i hav one data table in which some decimal values are up 6 decimal places.. im trying to bind that Data table to DataGridView while binding i want to round decimal values up to two decimal palces here is my code
dt.Columns.Add("Orderid", typeof(string)); dt.Columns.Add("tagnumber", typeof(string)); dt.Columns.Add("Minimum Value", typeof(string)); dt.Columns.Add("Maximum Value", typeof(string)); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++)
I was read your post: "Export GridView to Excel in ASP.Net with Formatting using C#" and is very useful. That code works perfect. But I need create a new format for a specific column in my sheet before to export it. For example:My DataTable have a column with decimal numbers and I'm trying reduce the tenths for each number.I want this: 2,874444 ----> 2,87 for a specific range. In this case I need it for all numbers in the column 13 or well said for the Column called N in Excel. Only reduce two tenths.