Posts

Showing posts from 2012

Crystal Report by DataSet

   วิธีการสร้างหน้ารายงานที่จำเป็นต้องพิมพ์อย่างมีรูปแบบนั้น ณ ปัจจุบันนักพัฒนาคงใช้ Crystal Report (CR) กันอยู่แน่ๆเลย แต่หลังจากที่ใช้งาน CR ด้วยการเขียน Command แล้วเจอปัญหากรณีที่เป็น Report ที่มีจำนวนหน้ามากๆ ทำให้ตอนแสดงผล และทำการเปลี่ยนหน้าใหม่นั้นค่อนข้างช้า ดังนั้นผมจะขอแนะนำการเขียน Crystal Report โดยใช้ DataSet ในข้อมูลครับ - ทำการเพิ่ม DataSet เข้าที่ Project ที่ชื่อว่า myDataSet ของเราก่อน - ทำการสร้าง DataTable ตามข้อมูลที่เราต้องใช้งาน สมมติชื่อว่า myDataTable - ทำการสร้างไฟล์ CrystalReport ตามรายงานที่เราต้องการ โดย Database Fields ให้เลือกเป็น myDataSet ของเรานั่นเอง และทำการวาง Field ต่างๆได้เลย โดยใช้ชื่อว่า CR.rpt - สร้าง Crystal Report Viewer Control ที่หน้า aspx ชื่อว่า CrystalReportViewer1 - ทำการ Import Component ที่จำเป็นต้องใช้งานที่ aspx.vb    Imports CrystalDecisions.Shared   Imports CrystalDecisions.CrystalReports.Engine   Imports CrystalDecisions.Web - ประกาศตัวแปรที่จำเป็นต้องใช้   Dim rpt as new ReportDocument   Dim ds as new myDataSet - ทำ

Autohotkey L Introduction

"Autohotkey L is power option for autohotkey original" - Create object for Excel Apps. Xl := ComObjCreate("Excel.Application") - Open Excel file. Xl_Workbook := Xl.Workbooks.Open("C:\Book1.xlsx") - Show Excel file. Xl.Visible := True - Access to Data. y := Xl.Sheets(1).Range("A1").Value Loop, 3 {   x := Xl.Sheets(1).Range("D" . A_Index).Value } - Save Excel file. Xl_Workbook.Save() - Close Excel file. Xl.Workbooks.Close

Initial of HP Switching

HP A5500 EI 48Port and HP A5120 EI 48Port Config IP Address Connect HP Switching by Serial Port. Run "Hyper Terminal" Use COM port connected. Port Setting is Bits per second = 9600 Data bits = 8 Parity = None Stop bits = 1 Flow control = None Enter 2 time. system [HP] int v 1 [HP-Vlan-interface1] ip address [IP Address] [Subnet Mark] [HP-Vlan-interface1] quit [HP] ip route 0.0.0.0 0 [Gateway] [HP] save Confirm is Y. Enter for use default filename. Add User [HP] local-user admin >>>>>>>> Add username is admin [HP-luser-admin] password cipher [Password] [HP-luser-admin] service-type telnet terminal [HP-luser-admin] authorization-attribute level 3 [HP-luser-admin] dis this  >>>>> Display user admin information [HP-luser-admin] quit [HP] user-interface vty 0 15 [HP-ui-vty0-15] authentication-mode scheme [HP] save Confirm is Y. Enter for use default filename. Overwirte is Y.

Link Server

      การที่เรามีฐานข้อมูลที่หลากหลายมากกว่า ไม่ว่าจะมีทั้ง Microsoft SQL Server, Oracle และอื่นๆ แต่จำเป็นที่บางรายงานต้องทำการแสดงผล โดยใช้ข้อมูลที่หลายๆแหล่งผ่าน Query เพียงครั้งเดียวจะทำได้อย่างไร ตอนนี้เรามีทางออกให้แล้วโดยทำการสร้าง Link Server ที่ MS SQL Server นั่นเอง 1. ตัวอย่าง เราใช้ฐานข้อมูลที่เป็น MS SQL อยู่ 2 เครื่อง โดยที่เครื่องแรกเป็น MS SQL 7.0 และ MS SQL 2005  วิธีการ คือ ใช้ทำการสร้าง Link Server ที่เครื่อง MS SQL 2005 เชื่อมต่อไปยัง MS SQL 7.0 โดยทำการเชื่อมต่อในรูปแบบ OLEDB for ODBC ดังนี้ EXEC sp_addlinkedserver @server = 'MSSQL7' , @srvproduct = 'Microsoft SQL Server 7.0' , @provider = 'MSDASQL' , @provstr = 'Driver={SQL server};server= MSSQL7 ;Database=DB;AutoTranslate=False' Reference Link 2. ตัวอย่าง การใช้ MSSQL เข้าไปดูข้อมูลของ MySQL โดยที่ก่อนอื่นต้องทำการติดตั้ง ODBC เสียก่อน ตามลิ้งนี้เลยจ้า EXEC master.dbo.sp_addlinkedserver  @server = N'MySQL',  @srvproduct=N'MySQL',  @provi

Send Mail CDO Object by IIS 7

   ถ้าคนที่เขียน ASP Classic ใช้การส่งเมลล์โดยใช้ Object เป็น CDO.Message นั้น หลังจากที่ย้ายจากเดิม IIS6 ไปเป็น IIS7 จะสังเกตได้ว่าโปรแกรมจะเกิด Error เกิดขึ้น  วิธีการแก้ไข 1. ไปที่ IIS7 แล้วไปที่ Application Pool ที่เราใช้งาน WebSite ดังกล่าว 2. เลือก Advanced Setting 3. Process Model > Identity = ApplicationPoolIdentity ให้ทำการเปลี่ยนเป็น NetworkService

Windows picture and fax viewer

Windows Picture and Fax Viewer is Loss. You can enable for TIF by... Step 1. Go to My Computer Step 2. Tools > Folder Options > Tab :: File Types Step 3. Search Extensions TIF (if haven't) Step 4. Click New... Step 5. File Extension = TIF and click OK. Step 6. Click Advanced  Step 7. Click New... Step 8. Action = open Step 9. Application used to perform action: = rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen %1 Step 10. Click OK.

Shared Contact Loss on Outlook Express

Step 1. Backup address book by export to *.wab Step 2. Delete user profile and create new user profile. Step 3. Go to address book of outlook express Step 4. Import address book from *.wab Step 5. Move address book from Main to Shared Contact Finish

Ping.exe Command.

     หลายๆคนเคยใช้งาน Ping เพื่อใช้ในการตรวจสอบว่าเครื่องดังกล่าวยังออนอยู่หรือเปล่า แต่ระยะหลังๆมาได้ถูกป้องกันจาก Firewall ของเครื่อง Client เองปิดกั้นไม่ให้ทำการ Ping หรือ ถูกปิดกั้นจาก Firewall ที่เป็นอุปกรณ์ก็เป็นได้ ดังนั้นการต้องการใช้งาน Ping นั้นจำเป็นต้องทำการ allow ให้ Firewall รู้จัก Ping และอนุญาติให้สามารถใช้งานได้ Ping.exe เป็นการใช้งานผ่าน Protocol ที่ชื่อว่า ICMP ไม่ใช่วิ่งผ่าน TCP ดังนั้นจึงไม่มีการระบุ Port การใช้งาน เหมือนกับหลายๆคนสงสัยนั่นเอง

WebServer on CentOS 6.3

Apache Web Server - CentOS 6.3 have apache (httpd service). - # service httpd start - # chkconfig httpd on PHP  - # yum -y install php php-mysql - # service httpd restart phpMyAdmin - Download .gz from http://www.phpmyadmin.net - # yum -y install php-mbstring - # service httpd restart - # tar xvfz phpMyAdmin-3.5.2.2-all-languages.tar.gz - # mv phpMyAdmin-3.5.2.2-all-languages /var/www/html/phpMyAdmin - # cd /var/www/html/phpMyAdmin - # cp config.sample.inc.php config.inc.php - Change $cfg['Servers'][$i]['auth_type'] = 'cookie'; to $cfg['Servers'][$i]['auth_type'] = 'http';

Database Server on CentOS 6.3

- # yum install mysql-server - # service mysqld start - # chkconfig mysqld on Create password for root - # mysqladmin -u root password mypassword Config Database - # mysql -u root -p - mysql> drop database test; - mysql> delete from mysql.user where user = ''; - mysql> flush privileges;

FTP Server on CentOS 6.3

- # yum install vsftpd - # service vsftpd restart - # chkconfig vsftpd on Create user and create home directory - # useradd -d /var/www/html/user01 user01 - # passwd user01 - # chmod 755 /var/www/html/user01 Config vsftpd [access owner folder only] - # /etc/vsftpd/vsftpd.conf      >> anonymous_enable=YES >> anonymous_enable=NO      >> #chroot_local_user=YES >> chroot_local_user=YES

Setup ClearOS for NAKIN.NET

Install ClearOS and choose Service DHCP and Local DNS, Intruction Prevention, Web Proxy, Web Server, Database. Restore WebConfig Set LAN Card Web Config is internet line have weight to 200 Web Config set Intruction Prevention & Intruction Detection is on boot - Automatic Download file and send to ClearOS Server  [Download here] squid_SEVEN_bysiamcafedotnet.tar.gz By MR.BOM@SiamCaFe.net checkwan.sh  By golfberserk@Internetcafe.in.th Install Squid Check version squid  #squid -v If squid 2.6 or 2.7 else 2.5 install squid2.6 first #service squid stop #tar -zxvf squid_SEVEN_bysiamcafedotnet.tar.gz #cd squid_SEVEN_bysiamcafedotnet #./install copy squid.conf to /etc/squid  #service squid restart Install Firewall #copy rc.firewall.local ไปไว้ที่ /etc/rc.d #service firewall restart Install Checkwan Copy to /usr/local/sbin/  Change Permission to 777 Use by #checkwan.sh [ip address] Install no-ip #wget  http://www.no-ip.com/client/linux/noip-duc-li

AutoHotKey Introduction

" Autohotkey is software for automatic of mouse or keyboard " :: Click Enter (Keyboard) Send, {ENTER} :: Sleep Sleep, 1000 ;1000 = 1 Sec. :: Show Desktop Send, #d Send, {LWin Down}d{LWin Up} :: Run Program Run, notepad.exe :: Wait windows have title is "Untitled - Notepad" about 3 seconds WinWait, Untitled - Notepad, , 3 :: Win Activate have title is "Calculator". WinActivate, Calculator :: Shrinks the window to 1/2 screen on the left side for side by side viewing. (Windows 7 only) Send, {LWin Down} {Left} {LWin Up} Send, {LWin Down} {Right} {LWin Up} :: Control Focus ControlFocus, OK, Window Title ; Set focus to the OK button :: Control Set Text ControlSetText, Edit1, Data, Window Title :: Install Program Auto RunWait, 7z922.exe /S

Disable/Enable Sound Device

Server Edition ::  Windows Server 2003 R2 Standard Edition Group Policy ::  Computer Configuration >> Windows Settings >> System Services >> Windows Audio Steps ::  - Check box "Define this policy setting" - Choose Radio Disabled - Click OK

Verify Group Policy on Client

Image
1. Go to client and click start > run and type rsop.msc 2. Right-click and choose property on User Configuration 3. Re-check Group Policy List and Status Credit :: superjumboa@thaiadmin.org

Create Ghost11.5 on USB

Extract file  USB _Boots_Ghost .rar Extract file  Usb_Dos.rar in folder  USB _Boots_Ghost Run  usb_format.exe Device = USB (Flash Drive) File System = Fat32 Format Option = Check "Quick Format" Format Option = Check "Create a DOS startup disk" Browse to folder is = USB _Boots_Ghost\Usb_Dos Copy ghost.exe to USB (Flash Drive)

Disable Button OnClick Event

Question. User double-click on the button then data double rows. Solution.  On Event Page_Load Button1.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(Button1, Nothing) + ";")

Allow Firewall PDM Server.

Allow TCP Port is 3030

ชื่อไฟล์ต่างๆเป็นตัวหนังสือสีน้ำเงิน

" การที่ชื่อไฟล์ต่างๆในเครื่องเป็นสีฟ้านั้นหมายถึงไฟล์นั้นได้มีการถูกบีบอัดเอาไว้ ไม่ได้ติดไวรัสหรือสปายแวร์แต่อย่างใด การบีบอัดนี้เป็นมาตรฐานของวินโดวส์ ซึ่งจะบีบอัดไฟล์ในไดร์ฟเพื่อให้มีพื้นที่ไว้ใช้งานมากขึ้น " การแก้ไขให้ลองคลิกขวาที่ตัวไดร์ฟในเครื่องของคุณ   แล้วเลือก Properties เลือกหัวข้อ Compress drive to save disk ออก ซึ่งจะเป็นการปิดการอนุญาตให้มีการบีบอัดไฟล์ในไดร์ฟนั้นๆทุกไฟล์ครับ

StoreProcedure :: Cursor

-- ## Create New Table Name is "tbl_cursor" CREATE TABLE tbl_cursor ( f1 varchar(10),f2 varchar(10) ) -- ## Insert data to tbl_cursor INSERT INTO tbl_cursor(f1,f2) VALUES ('KEY1','DATA1') -- ## Declare variables DECLARE @variable1 VARCHAR(10) DECLARE @variable2 VARCHAR(10) -- ## Set data to variables SET @variable1 = 'Hello' SET @variable2 = '' -- ## Declare cursor variables DECLARE curs CURSOR FOR SELECT f2 FROM tbl_cursor -- ## Select data OPEN curs -- ## Open cursor variable -- ## Select data to cursor variable FETCH NEXT FROM curs INTO @variable2 -- ## While Loop Data All Record. WHILE @@FETCH_STATUS=0 BEGIN   -- ## IF Statement   IF @variable1 = 'Hello'       SET @variable2 = 'TRUE'   ELSE -- ## Else Statement       SET @variable2 = @variable2   -- ## Display   PRINT @variable1   PRINT @variable2   -- ## Select data to cursor variable   FETCH NEXT FROM curs INTO @variable2 END -- ## Clo

Error :: Attached; Missing Information

Rename or Delete HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\[Vault Name] . You should now be able to re-create the view.

Re-Config NO-IP

Get Prpcess ID for terminate process. #noip2 -S Terminate process #noip2 -K [Process ID] Re-Configulation noip2 -C

Ultra Hi-Speed Internet หลุดแล้วไม่ยอมต่อใหม่

     ปัญหาที่พบเจอหลังจากที่ได้เปลี่ยนไปใช้งาน Ultra Hi-Speed Internet แล้วต้องทำการเปลี่ยนแปลง Modem ใหม่ และ Modem เป็นตัวจัดการการเชื่อมต่อ Internet แทน Server ClearOS      ดังนั้น Server จะไม่สามารถ Check Status ของ Internet ได้ โดยเราสามารถไปดูได้ที่เมนู Multi-Wan จะเป็น Off-Line แทน      เบื้องต้นเราสามารถใช้คำสั่งเพื่อให้ Server ClearOS ทำการตรวจสอบการ Online อีกครั้ง ดังนี้ # ifdown eth1 # ifup eth1

วิธี Jailbreak iOS5 สำหรับ iPhone 4S, iPad2 ด้วย Absinthe

Image
** ทดลอง jaibreak IPAD2 แล้วสามารถทำได้เรียบร้อยครับ แต่ iPhone4S ยังไม่ได้ทดสอบเพราะไม่มีเครื่้องครับ ^^" สิ่งที่ต้องการ iPhone 4S running iOS 5.0, 5.0.1 (9A405 and 9A406) iPad 2 Wifi/GSM/CDMA running iOS 5.0.1 Downloads Download   iTunes 10.5.3  Download  Greenpois0n Absinthe 0.2 (Mac) Download   Greenpois0n Absinthe 0.2 (Windows) Download   Greenpois0n Absinthe 0.2 (Linux)  Download iPhone 4S 5.0 ( 9A334 ), 5.0.1 ( 9A40 5 ) หรือ 5.0.1 ( 9A406 ). Download iPad 2 5.0.1 ( 9A405 ) ขั้นตอนการ Jailbreak 1. เปิดโปรแกรม Absinthe ver. 0.1.2-1 จะพบหน้าตาแบบนี้   2. เสียบ iPhone 4S หรือ iPad 2 กับคอมพิวเตอร์ของคุณ 3. กดปุ่ม Jailbreak แล้วรอจนกว่าจะเสร็จ 4. จากนั้นได้ไอคอน Absinthe ที่หน้า (อุปกรณ์) ให้กดเข้าไปเลย มันจะพาคุณไปที่หน้าเว็บของ greenpois0n  (ตรงนี้อาจลองเข้าหลายๆรอบเพราะคนเข้าเยอะมันเลยคอนเน็ค database ไม่ได้) พอเข้าได้แล้วเครื่องจะ Reboot  แก้ปัญหา “error establishing a database connection” ให้ไปที่ Settings > General > Network >

โปรแกรมดู CD-KEY ของ Microsoft Windows XP

Download here. Credit by  Totgio@thaiadmin.org

Instruction Install WebServer on Windows Server 2008 R2 64-bits

Server Support - IIS 7.5 - ASP.NET Framework 4.0 (Chart) - ASP.NET Crystal Report - ASP.NET Connect Office Files. - ASP.NET AJAX Instruction 1. Install Operating Systems Windows Server 2008 R2 64-bits 2. Go to Server Manager > Roles > Add Roles > Check box Web Server (IIS) 3. Go to Server Manager > Roles > Add Roles Services > Check box     - Application Development (ASP.NET, .Net Extensibility, ASP, ISAPI Extensions, ISAPI Filters)     - Security (Basic Authentication, Windows Authentication, Digest Authentication)     - FTP Publishing Service 4. Go to Server Manager > Feathers > Add Feathers > .Net Framework 3.5 Feature 5. Install dotNetFx40_Full_setup.exe 6. Install CRRuntime_64bit_13_0_1.msi 7. Install ASPAJAXExtSetup.msi 8. Install AccessDatabaseEngine_x64.exe

Excel (.xlsx) Sheet To DataSet

1. Install Package Microsoft Access Database Engine 2010 Redistributable 2. Import NameSpace Imports System.Data Imports System.Data.Oledb 3. Development Dim myDataset As New DataSet() ''You can also use the Excel ODBC driver I believe - didn''t try though Dim strConn As String = " Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Excel.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES""; " ''You must use the $ after the object you reference in the spreadsheet (## Table Name is ExcelTest ##) Dim myData As New OledbDataAdapter("SELECT * FROM [Sheet1$]", strConn) myData.TableMappings.Add("Table", "ExcelTest") myData.Fill(myDataset) DataGrid1.DataSource = myDataset.Tables(0).DefaultView DataGrid1.DataBind() Refer :: Connection String