|
19 May 2022
Updated: 19 May 2022
Rating: 4.68/5
Votes: 6
Popularity: 3.64
Licence: CPOL
Views: 6,102
Bookmarked: 3
Downloaded: 10
Unless you have sufficient permissions (i.e. you are a protector) you can't see the moderation queue, so this is useless to you. Sorry!Spam waves: A flood of spammers filling the moderation queue with new users all advertising the same thing.
|
.NET
|
|
28 Jul 2013
Updated: 28 Jul 2013
Rating: 4.81/5
Votes: 11
Popularity: 4.81
Licence: CPOL
Views: 9,840
Bookmarked: 6
Downloaded: 213
The MessageBox class works, but...why is it in the middle of the screen? Why does it expand to stupid sizes? Why can't the user copy and paste from it? So, I brewed my own.
|
|
28 Apr 2011
Updated: 29 Apr 2011
Rating: 4.38/5
Votes: 8
Popularity: 3.96
Licence: CPOL
Views: 32,284
Bookmarked: 9
Downloaded: 0
Sometimes, it is helpful to find out if the .NET framework is installed on a machine, or get a user to check over the phone. But, some people should not be allowed near Regedit or the windows folder, so here is a safe way to get them to check.
|
Database Development
|
|
14 Jan 2012
Updated: 14 Jan 2012
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 69,290
Bookmarked: 2
Downloaded: 0
Visual Studio has a Server Explorer built in to handle database access - it can lalso generate database connection strings ready for saving in application config files.
|
SQL Server |
23 Sep 2012
Updated: 23 Sep 2012
Rating: 5.00/5
Votes: 4
Popularity: 3.01
Licence: CPOL
Views: 20,220
Bookmarked: 8
Downloaded: 0
Inserting a number of rows in a database isn't difficult, but how do you do it in a single command without concatenating strings?
|
|
26 Sep 2012
Updated: 27 Sep 2012
Rating: 4.98/5
Votes: 17
Popularity: 6.00
Licence: CPOL
Views: 100,809
Bookmarked: 7
Downloaded: 0
Why? Normally, it's because you stored it wrong...
|
|
18 Sep 2012
Updated: 18 Sep 2012
Rating: 4.94/5
Votes: 26
Popularity: 6.91
Licence: CPOL
Views: 136,224
Bookmarked: 39
Downloaded: 9,048
One of the things that it seems far to hard to find is a reliable way of backing up a database, and restoring it again later. Particularly for development, where the SQL server instance and the database are likely to be on your development machine, and very likely to be damaged by code.
|
|
24 Feb 2014
Updated: 24 Feb 2014
Rating: 4.88/5
Votes: 5
Popularity: 3.41
Licence: CPOL
Views: 66,446
Bookmarked: 10
Downloaded: 0
If you have an SQL column which contains a comma separated list of names, you may have wondered how to return it as individual rows in a SELECT statement. It's not too bad, really!
|
|
18 Jan 2015
Updated: 19 Jan 2015
Rating: 4.96/5
Votes: 8
Popularity: 4.48
Licence: CPOL
Views: 83,701
Bookmarked: 10
Downloaded: 223
Sometimes, you want to extract the filename (with or without the extension) from the full path of a file. It's easy in C# and so forth - just use the Path.GetFileName method. But what if you want it in SQL?
|
|
26 Jul 2017
Updated: 26 Jul 2017
Rating: 4.38/5
Votes: 16
Popularity: 5.01
Licence: CPOL
Views: 24,738
Bookmarked: 9
Downloaded: 0
Did you know that Windows provides a built in way to build SQL connection strings for you? Neither did I ... until I found UDL files.
|
|
28 Oct 2017
Updated: 28 Oct 2017
Rating: 4.38/5
Votes: 9
Popularity: 4.17
Licence: CPOL
Views: 36,916
Bookmarked: 5
Downloaded: 0
How do you call a Stored Procedure inside a query and use the SELECT results? Tricky...or is it?
|
|
20 Sep 2018
Updated: 20 Sep 2018
Rating: 4.00/5
Votes: 4
Popularity: 2.41
Licence: CPOL
Views: 10,612
Bookmarked: 1
Downloaded: 0
If you try to pass a DbNull.Value to an SQL Image column, you get an exception: "Operand type clash: nvarchar is incompatible with image" - not sure why it's throwing that, but it can be done.
|
DateTime
|
|
14 Jul 2011
Updated: 14 Jul 2011
Rating: 5.00/5
Votes: 4
Popularity: 3.01
Licence: CPOL
Views: 45,302
Bookmarked: 6
Downloaded: 0
Strangely, the .NET DateTime does not provide a Week Number. This extension rectifies this.
|
Desktop Programming
|
Windows Forms |
8 May 2011
Updated: 8 May 2011
Rating: 4.79/5
Votes: 12
Popularity: 4.79
Licence: CPOL
Views: 42,112
Bookmarked: 6
Downloaded: 0
The Visual Studio Property pane is a control, which can be used in WinForms like any other, and it provides a simple, easy to use property editor for your classes. However, it is not obvious how to get it to open a browse dialog for a file path property.
|
|
17 Apr 2023
Updated: 17 Apr 2023
Rating: 5.00/5
Votes: 5
Popularity: 3.49
Licence: CPOL
Views: 17,659
Bookmarked: 9
Downloaded: 0
How to add images to a Winforms Project so they are accessible as resources
|
WPF |
27 Apr 2019
Updated: 27 Apr 2019
Rating: 5.00/5
Votes: 9
Popularity: 4.77
Licence: CPOL
Views: 29,087
Bookmarked: 13
Downloaded: 0
This is an alternative for "List Only Files Created or Modified Yesterday in C#"
|
DevOps
|
Git |
25 Apr 2015
Updated: 25 Apr 2015
Rating: 4.68/5
Votes: 13
Popularity: 5.21
Licence: CPOL
Views: 119,062
Bookmarked: 26
Downloaded: 0
Getting started with GIT, Visual Studio, and BitBucket isn't difficult - but it can take a bit of working out. Here is a simple explanation of what to do to get a new project under source control.
|
General Programming
|
|
5 Jul 2010
Updated: 5 Jul 2010
Rating: 5.00/5
Votes: 22
Popularity: 6.61
Licence: CPOL
Views: 40,886
Bookmarked: 13
Downloaded: 0
Marking code you need to return to later
|
Exceptions |
10 Oct 2012
Updated: 10 Oct 2012
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 17,991
Bookmarked: 2
Downloaded: 0
If you are trying to follow the instructions on how to get your system up and running with Eclipse, you may get an error when installing ADT
|
Printing |
15 Dec 2022
Updated: 15 Dec 2022
Rating: 5.00/5
Votes: 5
Popularity: 3.49
Licence: CPOL
Views: 12,211
Bookmarked: 10
Downloaded: 0
How to print labels in Word
|
Mobile Apps
|
Android |
13 Mar 2015
Updated: 13 Mar 2015
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 13,111
Bookmarked: 6
Downloaded: 0
If (like me) you have a Nexus7 that was converted into a door-stop by Lollipop 5.0 or 5.0.2, this is a guide in how to skip the wait for Google to realise you might want 5.1!
|
Operating Systems
|
Windows |
23 Aug 2020
Updated: 23 Aug 2020
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 7,858
Bookmarked: 3
Downloaded: 0
Windows 10 and the ongoing "I can't find your mapped drives anymore" problem. A fix, hopefully!
|
|
7 Sep 2020
Updated: 7 Sep 2020
Rating: 4.76/5
Votes: 5
Popularity: 3.33
Licence: CPOL
Views: 17,285
Bookmarked: 8
Downloaded: 0
How to automatically copy release executables to a specific folder on a successful build
|
|
20 Aug 2016
Updated: 20 Aug 2016
Rating: 5.00/5
Votes: 6
Popularity: 3.89
Licence: CPOL
Views: 15,700
Bookmarked: 2
Downloaded: 0
Fast startup in Win10 seems to conflict with some apps, on some machines: I've seen it affect Chrome and Live Mail for example, as well as making shutdown a very long process on some laptops. But it's not obvious where the control for this is, hence this tip.
|
Productivity Apps and Services
|
Microsoft Office |
8 Feb 2014
Updated: 8 Feb 2014
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 19,343
Bookmarked: 8
Downloaded: 0
Reading a sheet into a database isn't difficult - it's just I keep forgetting how... :sigh: So I abstracted this from my working code so I wouldn't lose it again.
|
Programming Languages
|
ASP |
3 Jan 2011
Updated: 5 Jan 2011
Rating: 4.33/5
Votes: 3
Popularity: 2.07
Licence: CPOL
Views: 29,234
Bookmarked: 3
Downloaded: 0
When you provide a custom error handler page, it is useful to be able to log what caused the problem, so that you can fix it. Server.GetLastError() will not return anything in the page, though...
|
C# |
10 Feb 2013
Updated: 11 Feb 2013
Rating: 4.98/5
Votes: 20
Popularity: 6.48
Licence: CPOL
Views: 72,328
Bookmarked: 19
Downloaded: 0
It's one of those things that annoys me - and probably you - you set up five or so windows so they are in the right place on your desktop, and it lovely. Then you open them again tomorrow...and one of them always opens too big, and in the middle of the screen...
|
|
20 Apr 2012
Updated: 20 Apr 2012
Rating: 5.00/5
Votes: 35
Popularity: 7.72
Licence: CPOL
Views: 135,464
Bookmarked: 46
Downloaded: 0
There is a common theme in development: storing data files in the application folder. This is bad, and wrong, and should be stamped on!
|
|
29 Jun 2013
Updated: 30 Jun 2013
Rating: 4.80/5
Votes: 4
Popularity: 2.89
Licence: CPOL
Views: 12,811
Bookmarked: 9
Downloaded: 0
One of the tasks we often have to do is rename a file before creating a new version. But when we want to keep multiple versions, how do we find out which ones already exist?
|
|
20 Jan 2020
Updated: 20 Jan 2020
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 12,355
Bookmarked: 8
Downloaded: 0
It's pretty easy to let Windows Explorer drop files on a WinForms app, but I can never remember how. So since I needed a "file touch" app, I thought I'd document the process here.
|
|
23 Apr 2018
Updated: 23 Apr 2018
Rating: 5.00/5
Votes: 7
Popularity: 4.23
Licence: CPOL
Views: 11,221
Bookmarked: 9
Downloaded: 0
How to colour the individual cells of a DataGridView according to their content. For example, negative values can be Red, positive values Green to show "Up"s and "Down"s more easily.
|
|
2 Sep 2015
Updated: 2 Sep 2015
Rating: 4.93/5
Votes: 7
Popularity: 4.17
Licence: CPOL
Views: 28,138
Bookmarked: 7
Downloaded: 1,274
Sometimes, a chart can make data a lot easier to understand - but why does the Chart control make it so difficult to display multiple lines from a collection of objects?
|
|
31 Jul 2018
Updated: 31 Jul 2018
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 9,163
Bookmarked: 5
Downloaded: 0
Winforms BindingSource does not support Parameterized Queries - so your app crashes when your user types "doesn't"
|
|
21 Oct 2015
Updated: 21 Oct 2015
Rating: 5.00/5
Votes: 17
Popularity: 6.02
Licence: CPOL
Views: 25,862
Bookmarked: 16
Downloaded: 677
A simple "scratch card" like control for Winforms, where the user can reveal the image by "scratching off" a cover
|
|
16 May 2012
Updated: 16 May 2012
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 12,700
Bookmarked: 8
Downloaded: 0
Loading an image from a database isn't difficult, but it can waste time. If you are loading a large list of Images (or even thumbnails) from a DB but not using them immediately, then it can take some considerable time. Why not load them on demand instead?
|
|
9 Jan 2019
Updated: 9 Jan 2019
Rating: 5.00/5
Votes: 4
Popularity: 3.01
Licence: CPOL
Views: 10,326
Bookmarked: 4
Downloaded: 0
How to open a file specifically in the default browser, instead of the default app for the file type
|
|
19 Feb 2013
Updated: 3 Apr 2013
Rating: 5.00/5
Votes: 19
Popularity: 6.28
Licence: CPOL
Views: 63,701
Bookmarked: 21
Downloaded: 1,037
Questions here quite often ask "how do I send data from one form to another?" and I must have answered this a dozen times. So, a series of three tips to cover the process.
|
|
18 Feb 2013
Updated: 3 Apr 2013
Rating: 3.82/5
Votes: 23
Popularity: 5.20
Licence: CPOL
Views: 75,735
Bookmarked: 20
Downloaded: 1,714
Questions here quite often ask "how do I send data from one form to another?" and I must have answered this a dozen times. So, a series of three tips to cover the process.
|
|
18 Feb 2013
Updated: 3 Apr 2013
Rating: 4.94/5
Votes: 11
Popularity: 4.94
Licence: CPOL
Views: 47,328
Bookmarked: 15
Downloaded: 883
Questions here quite often ask "how do I send data from one form to another?" and I must have answered this a dozen times. So, a series of three tips to cover the process.
|
|
8 Aug 2013
Updated: 8 Aug 2013
Rating: 4.20/5
Votes: 3
Popularity: 2.00
Licence: CPOL
Views: 13,712
Bookmarked: 6
Downloaded: 0
If (like me) you use the Assembly version of your EXE to handle versioning, and you (like me) use the Settings.Settings for configuration items, then you've probably noticed the config is lost when the version is changed.
|
|
3 Sep 2017
Updated: 3 Sep 2017
Rating: 4.20/5
Votes: 2
Popularity: 1.26
Licence: CPOL
Views: 23,748
Bookmarked: 4
Downloaded: 0
How to pass parameters to a PrintDocument.PrintPage event
|
|
21 Nov 2017
Updated: 21 Nov 2017
Rating: 4.33/5
Votes: 3
Popularity: 2.07
Licence: CPOL
Views: 27,626
Bookmarked: 6
Downloaded: 189
There is a problem with accessing Excel files via OleDb which contain more than 255 columns: they are truncated and need to be fetched using ranges. But what do you do with DataTables after that?
|
|
25 Jun 2012
Updated: 25 Jun 2012
Rating: 4.71/5
Votes: 7
Popularity: 3.98
Licence: CPOL
Views: 45,467
Bookmarked: 10
Downloaded: 240
When you search for matching substrings, you may have noticed that Google matches accented characters to unaccented. If you are searching strings which may contain accented characters, you should consider doing the same.
|
|
23 Dec 2017
Updated: 23 Dec 2017
Rating: 5.00/5
Votes: 7
Popularity: 4.23
Licence: CPOL
Views: 11,460
Bookmarked: 5
Downloaded: 0
Does your derived class open in the Visual Studio Designer while having no UI? Annoying, isn't it? This is simple to fix.
|
|
28 Mar 2014
Updated: 28 Mar 2014
Rating: 4.85/5
Votes: 10
Popularity: 4.85
Licence: CPOL
Views: 29,931
Bookmarked: 12
Downloaded: 0
Want to use Linq, or Linq methods with the results from your Regex? Yes, so did I...annoying isn't it? So...a solution.
|
|
12 Apr 2012
Updated: 12 Apr 2012
Rating: 5.00/5
Votes: 6
Popularity: 3.89
Licence: CPOL
Views: 15,802
Bookmarked: 5
Downloaded: 0
If you haven't heard of AI Memo 239, then you need to have a look at it. It is an MIT memo from 1972 containing "clever code" and such like. Some of it is absolutely beautiful!
|
|
13 Jun 2012
Updated: 13 Jun 2012
Rating: 5.00/5
Votes: 4
Popularity: 3.01
Licence: CPOL
Views: 17,572
Bookmarked: 0
Downloaded: 99
It's very easy to work out the center of a rectangle, but it's messy as inline code. Hence these simple extension methods to provide the five centers.
|
|
29 Oct 2013
Updated: 29 Oct 2013
Rating: 4.83/5
Votes: 3
Popularity: 2.31
Licence: CPOL
Views: 17,543
Bookmarked: 5
Downloaded: 0
Abstract base classes are a very good idea - but when that base class is a UserControl, Visual studio gets very unfriendly. It is possible, and it's not difficult: you just have to know how to do it.
|
|
13 Apr 2014
Updated: 13 Apr 2014
Rating: 4.93/5
Votes: 20
Popularity: 6.31
Licence: CPOL
Views: 95,017
Bookmarked: 26
Downloaded: 0
Sometimes, I need to create files or folders directly, and use existing data to provide the file name - and then my app throws an exception because there are "illegal characters in the file name" - so this is a simple way to remove them.
|
|
1 Feb 2010
Updated: 5 Dec 2015
Rating: 4.82/5
Votes: 27
Popularity: 6.74
Licence: CPOL
Views: 68,085
Bookmarked: 18
Downloaded: 0
Hiding inherited properties and tasks in derived classes
|
|
25 May 2014
Updated: 25 May 2014
Rating: 4.88/5
Votes: 5
Popularity: 3.41
Licence: CPOL
Views: 17,603
Bookmarked: 9
Downloaded: 0
I needed to show file sizes in a "human friendly format" recently, so I thought I'd knock up a simple method to do it. So the file sizes such as 10123456789 bytes would display as 10.1Gb and so forth.
|
|
6 Jun 2015
Updated: 6 Jun 2015
Rating: 3.63/5
Votes: 4
Popularity: 2.18
Licence: CPOL
Views: 16,730
Bookmarked: 2
Downloaded: 0
If you have two DataTables and you want to join the "matching" rows together in a new table, this provides a simple way to do it.
|
|
2 Jul 2012
Updated: 2 Jul 2012
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 14,338
Bookmarked: 3
Downloaded: 72
Converting a value to an SI unit string.
|
|
14 Jun 2012
Updated: 14 Jun 2012
Rating: 5.00/5
Votes: 8
Popularity: 4.52
Licence: CPOL
Views: 26,385
Bookmarked: 3
Downloaded: 0
Having the property "Text" be available for almost everything in .NET that interacts with the user makes life very simple. But when you create a new UserControl, the Text property doesn't appear in the Properties pane.
|
|
22 Nov 2015
Updated: 22 Nov 2015
Rating: 4.20/5
Votes: 2
Popularity: 1.26
Licence: CPOL
Views: 14,091
Bookmarked: 3
Downloaded: 189
When you perform a mouse action on a TabControl tab, it isn't passed to the relevant TabPage. This shows how to do that.
|
|
15 Jul 2011
Updated: 18 Jul 2011
Rating: 4.98/5
Votes: 26
Popularity: 7.05
Licence: CPOL
Views: 99,042
Bookmarked: 24
Downloaded: 0
I wrote this because I was interested in a Q&A question which asked for exactly that. Since I quite often use DataTables to transfer data, and to display it for debugging I knocked up an extension method to do it.
|
|
9 Jan 2012
Updated: 18 Jun 2012
Rating: 4.87/5
Votes: 30
Popularity: 7.19
Licence: CPOL
Views: 175,231
Bookmarked: 34
Downloaded: 273
It seems like an obvious requirement, but the .NET framework will not count occurrences of a character in a string. It's easy to do, but which way is the quickest?
|
|
30 Mar 2013
Updated: 30 Mar 2013
Rating: 5.00/5
Votes: 12
Popularity: 5.40
Licence: CPOL
Views: 30,295
Bookmarked: 17
Downloaded: 144
Working with an Age (as in a persons age) is not the same as a Timespan, and there is no simple way to return an age. This provides a class to solve this.
|
|
13 Feb 2017
Updated: 13 Feb 2017
Rating: 4.71/5
Votes: 8
Popularity: 4.26
Licence: CPOL
Views: 13,861
Bookmarked: 5
Downloaded: 0
I embed a ToDo.txt and a RevisionHistory.txt file in every assembly - it helps me keep track of what has changed - and it normally gets read out and displayed in the "Help...About" dialog. But what if you want to read an embedded file from a different Assembly?
|
|
26 Oct 2013
Updated: 26 Oct 2013
Rating: 4.91/5
Votes: 9
Popularity: 4.68
Licence: CPOL
Views: 49,031
Bookmarked: 15
Downloaded: 652
StringBuilder is a very useful and memory efficient way to concatenate strings, but there is no obvious similar class for byte arrays. This class adds that, and provides a flexible binary data storage medium at the same time.
|
|
21 Jul 2016
Updated: 21 Jul 2016
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 14,261
Bookmarked: 1
Downloaded: 33
Scoring the FOSW of the day for people who find it difficult
|
|
2 Apr 2012
Updated: 2 Apr 2012
Rating: 4.85/5
Votes: 24
Popularity: 6.52
Licence: CPOL
Views: 155,254
Bookmarked: 31
Downloaded: 0
Getting the IP and MAC for your PC is pretty simple, but what if you need those on your local network? It's not as simple as it sounds...
|
|
20 Jul 2010
Updated: 23 Jul 2010
Rating: 4.29/5
Votes: 7
Popularity: 3.62
Licence: CPOL
Views: 14,080
Bookmarked: 5
Downloaded: 0
Sometimes, it helps to know the complete inheritance of an object or type in order to understand what can be done with it. This Tip presents a simple C# class to access the information
|
|
12 Aug 2010
Updated: 12 Aug 2010
Rating: 4.43/5
Votes: 11
Popularity: 4.61
Licence: CPOL
Views: 21,372
Bookmarked: 10
Downloaded: 0
Using enum really helps readability, but the values within the enum must understandably conform to the rules for variables names. This is fine until you need to display enum values to the user. This tip shows you how to associate and access a human readable string with each enum element.
|
|
26 Aug 2010
Updated: 26 Aug 2010
Rating: 4.67/5
Votes: 3
Popularity: 2.23
Licence: CPOL
Views: 21,101
Bookmarked: 1
Downloaded: 0
If your tutor asks you to convert years to the Roman equivalent, (e.g. 2010 to MMX) then you are not alone! Here is the simplest, most foolproof way to do it!
|
|
2 Mar 2011
Updated: 3 Mar 2011
Rating: 4.88/5
Votes: 54
Popularity: 8.37
Licence: CPOL
Views: 189,773
Bookmarked: 52
Downloaded: 0
Sending an email is not a real problem, but I am fed up with answering the question "How do I do it?" in Q&A . So, here is the generic routine I use to send an email, with or without attachments, so I can just point people at it!
|
|
25 Apr 2011
Updated: 29 Apr 2011
Rating: 4.93/5
Votes: 94
Popularity: 9.68
Licence: CPOL
Views: 169,440
Bookmarked: 116
Downloaded: 0
A lot of people are asking how to encrypt passwords, and I have answered "Don't do it" too many times. This Tip describes how to store a password in your database, and why.
|
|
31 Jul 2011
Updated: 31 Jul 2011
Rating: 4.50/5
Votes: 8
Popularity: 4.06
Licence: CPOL
Views: 25,456
Bookmarked: 5
Downloaded: 0
Sometimes, you want to only run a single instance of an application - this makes it very simple to do. An Extension method that checks, switches and kills as necessary.
|
|
16 Sep 2011
Updated: 18 Sep 2011
Rating: 4.85/5
Votes: 14
Popularity: 5.56
Licence: CPOL
Views: 61,290
Bookmarked: 4
Downloaded: 0
Recently, I had to write a quick app to load images into a database, and wanted to restrict the file type to just images. You can do this with the OpenFileDialog.Filter property, but it is a pain working out what file extensions to permit.
|
|
10 Oct 2011
Updated: 10 Oct 2011
Rating: 4.80/5
Votes: 5
Popularity: 3.36
Licence: CPOL
Views: 27,101
Bookmarked: 6
Downloaded: 0
Originally, I was going to create a simple Web Service using an ASMX file, but that appears to have been removed from Visual Studio 2010 - or at least I couldn't find it easily. So, WCF it is! I love the way technology lasts, don't you? Right, so I know nothing about WCF, tutorials here I come...
|
|
4 Jan 2012
Updated: 7 Jan 2012
Rating: 4.83/5
Votes: 14
Popularity: 5.22
Licence: CPOL
Views: 133,279
Bookmarked: 11
Downloaded: 0
One of the things missing from C# is the ability to set a default value of auto-implemented properties. You can set a default for variable backed properties, and you can set them for the designer. This does it for you.
|
|
12 Jan 2012
Updated: 13 Jan 2012
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 46,795
Bookmarked: 3
Downloaded: 0
XmlSerializer complains if you try to serialize anything which implements IDictionary. This provides a way of serialising them which (if not capable of restoring the exact dictionary content) restores the actual field contents in a new dictionary.
|
|
24 Jan 2012
Updated: 31 Jan 2012
Rating: 4.83/5
Votes: 16
Popularity: 5.53
Licence: CPOL
Views: 52,821
Bookmarked: 15
Downloaded: 0
Sometimes, all I want is a control which allows the user to select one of several options, and tell me which one - ideally as a handy enum value. This shows a simple method which allows this.
|
|
19 Aug 2010
Updated: 12 May 2013
Rating: 4.91/5
Votes: 77
Popularity: 9.05
Licence: CPOL
Views: 152,639
Bookmarked: 14
Downloaded: 0
If your tutor asks you to convert numbers to words (i.e. 565 to a string "Five hundred and sixty-five") then you are not alone! Here is the simplest, most foolproof way to do it.
|
|
17 Jan 2024
Updated: 17 Jan 2024
Rating: 5.00/5
Votes: 10
Popularity: 5.00
Licence: CPOL
Views: 12,900
Bookmarked: 22
Downloaded: 0
Why switch from the "traditional" BackgroundWorker to a Task? The old way works OK, but the new way generates "tidier" code which keeps stuff together (and needs less code)
|
|
31 Oct 2013
Updated: 31 Oct 2013
Rating: 4.92/5
Votes: 3
Popularity: 2.35
Licence: CPOL
Views: 7,820
Bookmarked: 2
Downloaded: 0
Sometimes (far too often, I find) you will try to open a form in the Visual Studio designer, and it won't open it because "the type X declared in Project X is not the same as the type X declared in Project X". This is annoying, as well as being blatantly untrue. Stop laughing at the back there!
|
|
17 Jun 2014
Updated: 17 Jun 2014
Rating: 5.00/5
Votes: 20
Popularity: 6.51
Licence: CPOL
Views: 33,911
Bookmarked: 12
Downloaded: 12
The Article editor does work - but sometimes it does do things the hard way, and tries to frustrate you on purpose, I'm sure...
|
C# 3.5 |
27 May 2014
Updated: 27 May 2014
Rating: 5.00/5
Votes: 5
Popularity: 3.49
Licence: CPOL
Views: 67,282
Bookmarked: 8
Downloaded: 0
This is really easy - but it's hard to work out for the first time. For example, get a list of files, and group them by the date which is in the 2nd to 10th characters of the name, ignoring extensions. Easy!
|
C# 5.0 |
3 Jul 2014
Updated: 3 Jul 2014
Rating: 4.74/5
Votes: 10
Popularity: 4.74
Licence: CPOL
Views: 25,574
Bookmarked: 14
Downloaded: 618
I've answered quite a few questions in the last couple of months about how to get the physical location of a client from a website. And people seem to get annoyed when I say: "Don't. It's no real use". But that's the truth: you can get it, but it won't be accurate. Let's have a look and see why.
|
C# 8.0 |
16 Jul 2023
Updated: 16 Jul 2023
Rating: 4.98/5
Votes: 10
Popularity: 4.98
Licence: CPOL
Views: 11,341
Bookmarked: 8
Downloaded: 0
I am switching to C# 8 / .NET 7 so I'm recreating my project templates to create suitable versions. And it's not trivial as some things are very different.
|
SQL |
18 Dec 2013
Updated: 18 Dec 2013
Rating: 4.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 9,040
Bookmarked: 7
Downloaded: 0
Getting totals for a specific period: this week, this month, this year. And last week, last month, and last year.
|
|
27 Apr 2013
Updated: 7 May 2013
Rating: 4.92/5
Votes: 23
Popularity: 6.70
Licence: CPOL
Views: 354,773
Bookmarked: 24
Downloaded: 273
Passing a comma separated list of values to an SQL query is all very well, but you can't just use them in an "IN" clause. This helps.
|
|
14 Jul 2013
Updated: 14 Jul 2013
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 7,390
Bookmarked: 3
Downloaded: 0
If you have two (or more) tables which are interrelated, you sometimes need to update the rows of one table, selected from information in a different table. This isn't difficult, but is can take a little think about.
|
|
24 Mar 2020
Updated: 24 Mar 2020
Rating: 4.57/5
Votes: 6
Popularity: 3.56
Licence: CPOL
Views: 16,029
Bookmarked: 3
Downloaded: 0
A basic user defined function to remove minute and second from a DATETIME
|
|
26 Dec 2019
Updated: 26 Dec 2019
Rating: 0.00/5
Votes: 0
Popularity: 0.00
Licence: CPOL
Views: 4,223
Bookmarked: 0
Downloaded: 0
Select users with a birthday in the next "n" days is pretty easy, if you use the day of year. The only slight complication is the need to "wrap" round the year end.
|
|
14 Sep 2021
Updated: 14 Sep 2021
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 9,224
Bookmarked: 2
Downloaded: 0
How do you get last weeks data only? It's a little more complex than you might have thought
|
Visual Basic |
26 Jan 2010
Updated: 26 Jan 2010
Rating: 4.86/5
Votes: 12
Popularity: 5.24
Licence: CPOL
Views: 57,077
Bookmarked: 7
Downloaded: 0
Normally I keep information like this in a text file, in a folder called "How To Do It", as it is handy to have around, and too much work to search for each time I need it, but too much detail for me to remember if I don't use it often. Formatting a DateTime for display:DateTime.ToString()...
|
|
26 Jan 2010
Updated: 18 Feb 2012
Rating: 4.97/5
Votes: 27
Popularity: 7.11
Licence: CPOL
Views: 86,557
Bookmarked: 15
Downloaded: 0
Disable the Close box on a form
|
Visual Studio
|
|
10 Feb 2011
Updated: 12 Feb 2011
Rating: 5.00/5
Votes: 49
Popularity: 8.41
Licence: CPOL
Views: 68,027
Bookmarked: 32
Downloaded: 0
F1 in Visual Studio takes forever, and rarely comes up with anything useful. Replace it with a Google MSDN search!
|
|
17 Jul 2010
Updated: 9 Oct 2011
Rating: 4.96/5
Votes: 17
Popularity: 5.97
Licence: CPOL
Views: 29,052
Bookmarked: 15
Downloaded: 0
Adding your items to Visual Studio default files
|
|
16 Nov 2011
Updated: 20 Nov 2011
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 20,601
Bookmarked: 4
Downloaded: 0
It is really easy to do once you get the idea how, but the Microsoft documentation could be a lot clearer - so here is a simple sample with full instructions.
|
|
8 Jan 2012
Updated: 8 Jan 2012
Rating: 4.90/5
Votes: 10
Popularity: 4.68
Licence: CPOL
Views: 27,340
Bookmarked: 9
Downloaded: 0
Quite often, when I create a new form, the first thing I need to add is an OK and a Cancel button. Recently, I realized that I could create templates for these in Visual Studio and save some time.
|
Web Development
|
ASP.NET |
5 Jan 2011
Updated: 7 Jan 2011
Rating: 5.00/5
Votes: 5
Popularity: 3.49
Licence: CPOL
Views: 28,482
Bookmarked: 13
Downloaded: 0
Supporting Development and Release web.config in ASP.NET
|
|
7 Feb 2011
Updated: 8 Feb 2011
Rating: 5.00/5
Votes: 11
Popularity: 5.00
Licence: CPOL
Views: 20,204
Bookmarked: 9
Downloaded: 0
When I add a log reader, the size of the log can be huge, and get very slow to view. This makes the GridView do all the work of paging the data for you.
|
|
14 Aug 2011
Updated: 14 Aug 2011
Rating: 4.83/5
Votes: 5
Popularity: 3.38
Licence: CPOL
Views: 26,013
Bookmarked: 6
Downloaded: 0
Getting an image from a database and displaying it in an ASP.NET page is something we have to do quite often. Here is a generic class which does the job for you.
|