February 29, 2012

Speed Up File Copy in Windows 7

1- Disable Auto-tuning
Command: netsh interface tcp set global autotuninglevel=disabled

2- Remove RDC
Control Panels > Programs and Features > Turn Windows features on or off > Unchecked Remote Differential Compression

3- Remove IPv6
Control Panel > Network and Sharing Center > Change adaptor settings > Right click on your enabled network >  Properties > Uncheked Internet Protocol Version 6 (TCP/IPv6)

4- Clear DNS Cache
Command: ipconfig /flushdns

February 28, 2012

Print DOS Application With Windows Printer

Problem
- How can i print with laser and inkjet printers with MS-DOS Application
- How to print with old DOS programs

Solution A
The DOSPRN can help you ;-)
Site: www.dosprn.com
FAQ: www.dosprn.com/faq.htm

Solution B
Download the PRN2FILE and run it in DOS mode. This resident DOS application converts the print task to PRN file.
You can use of below command for save print task in 1.PRN.
Command: prn2file.com C:\1.PRN
For start automatically in each start command in windows you can append the above command in end of %windir%\system32\autoexec.nt file.
Site: cejvik.xf.cz/prilohy/dos_usb_print_prn/
Link ver1.0: cejvik.xf.cz/prilohy/dos_usb_print_prn/prn2file.zip
Link ver1.0: http://www.4shared.com/rar/j2SARDvj/20120228-prn2file.html
Link ver1.1 (+modification):  ftp://ftp.simtel.net/pub/simtelnet/msdos/printer/prn2fil3.zip
Link ver1.1 (+modification):  http://www.4shared.com/zip/r9vT8VwT/20120303-prn2file11.html

Usage (v1.0): PRN2FILE [path][filename][/Pn][/Bnn][/F][/A][/U]
Run PRN2FILE with the desired filename to activate it.
Run it with a different filename to change destination file.
/P to designate the printer number (defaults to 1)
/B to enter buffer size in K bytes (defaults to 4)
/F to print just to file and not to printer (default is both) [in v1.1 only]
/A to append to file (default is to create new file) [in v1.1 only]
/U to uninstall the program

February 22, 2012

Connection is busy with results for another hstmt

Problem
- What's this ERROR [HY000] [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
- I have problem with OdbcCommand in C# ...
- The {System.Data.Odbc.OdbcErrorCollection} error comes after ExecuteReader


Solution A
Add a  SET NOCOUNT ON in first line of CommandText of your Command

Solution B
Change ExecuteReader() to ExecuteNonQuery() or ExecuteScalar()

January 20, 2012

No row was updated

Error:
- A SQL Server Database contains some tables but one of table's rows cannot be updated!!
- How i can update some NULL rows in my table ?
- Can't update rows (...) in Microsoft Visual Studio ...

Error Message:
No row was updated.
The data in row X was not committed.
Error Source: Microsoft.VisualStudio.DataTools.
Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(N rows).
Correct the errors and retry or press ESC to cancel the change(s).
Problem Causes:
This issue occurs if the following conditions are true:
- The table contains one or more columns of the text or ntext data type.
- The value of one of these columns contains the following characters:
        - Percent sign (%)
        - Underscore (_)
        - Left bracket ([)
- The table does not contain a primary key.

Solution:
This is a Microsoft BUG (BUG-925719)
There's not any solution. You need to have a new table with a primary key or correct values and copy data into new table and drop old table, Sorry.


Solution In Microsoft Visual Studio 
(NEW):

- Goto Server Explorer
- Goto Database > Tables > The Table
- RightClick and Select Edit Table Schema
ADD a new Column with these options
        - Data Type: uniqueidentifier
        - Allow Nulls: No
        - Unique: Yes
        - Primary Key: Yes
        - Is RowGuid: True
- Save and Close and open Table and update rows ;-)


REF: 
http://amastaneh.blogspot.com/2012/01/no-rows-were-deleted.html