Posts

Donate

.NET Framework Version Checker in your PC Using C#

Here's a repost of a .NET Version Checker I found in the internet. const string regLocation = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" ; static void Main( string [] args){ Console.WriteLine( ".NET Framework versions installed" ); Console.WriteLine( "---------------------------------" ); Console.WriteLine(); RegistryKey masterKey = Registry.LocalMachine.OpenSubKey(regLocation); RegistryKey tempKey; if (masterKey == null ) { Console.WriteLine( "Null Key!" ); } else { string [] SubKeyNames = masterKey.GetSubKeyNames(); for ( int i = 0; i < SubKeyNames.Length; i++) { tempKey = Registry.LocalMachine.OpenSubKey (regLocation + "\\" + SubKeyNames[i]); Console.Write(SubKeyNames[i]); Console.WriteLine( "\t...

The Error: 417 "Expectation Failed." During Webrequest In C#

Here's a solution on how to fix the 417 expectation failed error during WebRequest In C#. System.Net.ServicePointManager.Expect100Continue = false ;

How To Insert Date Object In MySQL Using C#.NET

Hello, To insert date object using C#.net in MySQL db,use the code below: string query = String.Format( "Insert into tbllistings(DateRegistered)" + "values(DATE_FORMAT({0}, '%Y-%m-%d %h:%m:%s'))" ,objJobs.DateRegistered); The key to the solution is using the MySQL Date format function.

Disable WindowsForms Form From Being Resized At Design Time In C#

Here's a snippet on how to prevent or disable winforms form object from being resized at design time. this .MaximumSize = new System.DrawingSize(500, 400); this .MinimumSize = new System.DrawingSize(500, 400);

MySQL Date Range Query (Using Logical Operators)

Here's another version using logical operators in MySQL. 1: select date_format(date_purchased, '%m/%d/%Y' ) as dates, 2: url from dbcommerce.tblproducts 3: where date_format(date_purchased, '%m/%d/%Y' ) >= '04/30/2011' 4: and date_format(date_purchased, '%m/%d/%Y' ) <= '05/30/2011' 5: order by date_purchased asc ;

MySQL Date Range Query Example

Here is an example to query MySQL Date Range given the date field is of type TimeStamp. The date_format() will remove the time part in comparing. select date_format(date_purchased, '%m/%d/%Y' ) as dates, url from dbCommerce.tblproducts where date_format(date_purchased, '%m/%d/%Y' ) between '04/30/2011' and '05/30/2011' order by date_purchased asc ;

Unable To Convert MySQL DateTime Value To System.DateTime In C# Or ASP.NET

Solution: Add Allow Zero to your Web.Config or App.Config <add key= "connectionString" value= "Database=your_db ;Data Source=localhost;User Id=root; Password=password;Allow Zero Datetime=True;" /> Cheers!

Newline For C# Equivalent With Environment.Newline

txtOutput.Text = "Select All Nodes" + "\r\n" ; //or txtOutput.Text = "Select All Nodes" + Environment.Newline;

Setup SQL Developer To Connect To A MySQL Database

1. Download sql developer from oracle site 2. Copy sql developer to drive C:\ 3. Copy msvcr71.dll to %WinDir%\System32 [reference: http://gisbiz.com/2011/05/fixing-the-sql-developer-msvcr71-dll-error/] msvcr71.dll is located in: [sqldeveloper\jdk\jre\bin\msvcr71.dll] 4. Download mysql-connector-java-5.0.8-bin.jar zip file from this site: Download MySQL connector Java 5. Extract mysql-connector-java-5.0.8-bin.jar in sql developer lib folder: C:\Users\gnesguerra\Downloads\sqldeveloper-3.0.04.34\sqldeveloper\lib 6. Setup sql developer to connect to mysql database using the tutorial from this site: Starting from Setting it Up Paragraph: Configuring SQL Developer for MySQL    6.1 Click Choose Database button below Port label.    6.2 Beside the Choose Database button, select the database you want to connect to from the dropdown control.    6.3 Zero Date Handling should be set to null    6.4...

Retrieve Record Counts For All Tables In MySQL DB

Reference: Get Record Counts for All Tables in MySQL

Donate