How to select an element with its name attribute in jQuery

To select an element with its name attribute in jQuery you can use the snippet below.

Samples

Javascript Sample

if you remove the div in div[name=”de.Fesslersoft.Testname”] you will get all elements with the specific name.

You can also have a look at this JSFiddle.

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to catch specific MS-SQL SQLExceptions in C# and VB.NET

To catch specific SQLExceptions using Microsoft.NET and Microsoft Sequel Server you can use the snippet below. You also need to look for the specific error numbers/codes you want to catch. To do this you can either execute the following query in the SQL Management Studio or you can use this
List of SQLException Numbers/Codes (Direct-DL around 15mb).

Samples

T-SQL Sample

C# Sample

VB.NET Sample

Compatibility: working .NET 2.0 working .NET 3.0 not tested .NET 3.5 not working .NET 4.0 not working .NET 4.5not working .NET 4.6

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to get all types that implement a specific Interface in C# and VB.NET

To retrieve a IEnuemerable of all types in the current or another Assembly that implement a specific Interface / Abstract class and so on, you can use the snippets below.

Methods

C# Version

VB.NET Version

Compatibility: working .NET 2.0 working .NET 3.0 not tested .NET 3.5 not working .NET 4.0 not working .NET 4.5

Do you have an alternate or better method for this task?
If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to disable comments on posts older than date X in WordPress

To disable comments on posts older than date X in WordPress you can use the snippet below.

Sample mySQL

UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2013-01-01' AND post_status = 'publish'

Please rate this snippet

How to open a pdf at a specific page using AcroRd32Info in C# and VB.NET

To open a pdf at a specific page using AcroRd32Info in C# and VB.NET you can use the following snippet.

Sample C#

public static void OpenPdfAtPage(string document, int page) 
{
	object myProcess = new Process();
	object startInfo = new ProcessStartInfo();
	startInfo.FileName = "AcroRd32Info.exe";
	startInfo.Arguments = string.Format("/A \"page={0}\"{1}", page, document);
	myProcess.StartInfo = startInfo;
	myProcess.Start();
}

Sample VB.NET

Public Shared Sub OpenPdfAtPage(document As String, page As Integer)
	Dim myProcess = New Process()
	Dim startInfo = New ProcessStartInfo()
	startInfo.FileName = "AcroRd32Info.exe"
	startInfo.Arguments = String.Format("/A ""page={0}""{1}", page, document)
	myProcess.StartInfo = startInfo
	myProcess.Start()
End Sub

Please rate this snippet