วิธีกำหนดตัวแปรในไฟล์ web.config ของ ASP.NET

บันทึกโดย TaTump วันที่ 17 June 2010 | 187 views

กำหนดตัวแปรในไฟล์ web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
.
.
.
<appSettings>
<add key="cfgWebTitle" value="Memo8.com" />
</appSettings>
</configuration>

วิธีอ่านค่า (C#)

string cfgWebTitle=ConfigurationManager.AppSettings["cfgWebTitle"].ToString();
Response.Write(cfgWebTitle);
Bookmark and Share

เปิดไฟล์ Master Pages ของ ASP.NET ใน Dreamweaver 8 ให้สามารถ Design ได้

บันทึกโดย TaTump วันที่ 12 June 2010 | 195 views

โดย Master Pages ของ ASP.NET นั้นจะเป็นนามสกุล master ซึ่ง Dreamweaver จะไม่รู้จัก ถ้าเรา Open With มาก็จะเป็น Text ไม่สามารถ Design ได้ วิธีที่จะทำให้ Dreamwever รู้จักไฟล์นามสกุล master อีกหนึ่งวิธีก็คือ

  1. ให้เข้าไปที่ C:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes ถ้าเป็น Windows 64 bit ก็เปลี่ยนชื่อ Program Files ไปเป็น Program Files (x86)
  2. หาไฟล์ชื่อ MMDocumentTypes.xml เปิดด้วยโปรแกรม text editor เพื่อแก้ไขไฟล์
  3. เมื่อเปิดมาแล้วให้ค้นหา “ASP.NET_VB” และ “ASP.NET_CSharp”
  4. หา attribute ที่ชื่อว่า “winfileextension” สังเกตุจะบรรจุค่าไว้ aspx,ascx,asmx ให้เราเพิ่ม master เข้าไป ดังนั้นจะได้เป็น winfileextension=”aspx,ascx,asmx,master”
  5. ปิด Dreamweaver แล้วเปิดใหม่ครับ เสร็จเรียบร้อยครับ

“ไม่แน่ใจว่าเวอร์ชั่นอื่นจะแก้ด้วยวิธีนี้รึเปล่านะครับ แต่ผมคิดว่าพาธ config คงไม่ต่างกันมาก”

Bookmark and Share

วิธีแก้ไข SQL Server 2008 Error : Saving changes is not permitted.

บันทึกโดย TaTump วันที่ 12 June 2010 | 145 views

เพิ่งเปลี่ยนมาใช้ SQL Server 2008 พอจะแก้ไข Table แล้วก็เจอ Error

Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

ซึ่งเกิดจากระบบป้องกันการแก้ไข Table ของ SQL Server 2008 เอง เราสามารถปิด Option ตรงนี้ได้ครับ วิธีการดังนี้

  1. ดูที่  Tool bar ของ SQL Server 2008 ให้เลือก Tools >> Options
  2. จะมีหน้าต่างขึ้นมา ให้ดูทางด้านซ้าย ให้เลือก Designers
  3. มองหาคำว่า “Prevent saving changes that require table re-creation” แล้ว  uncheck และกดปุ่ม OK ครับ
Bookmark and Share

วิธีแก้ไข ASP.NET Error : The SELECT permission was denied on the object ‘table_name’, database ‘table_name’, schema ‘dbo’.

บันทึกโดย TaTump วันที่ 10 June 2010 | 136 views

จาก Error ตามหัวข้อเกิดจากไม่ได้ Add Permission (เพิ่งเคยเจอเหมือนกัน อุอุ) สามารถแก้ไขได้ดังนี้

  1. เปิดโปรแกรม SQL Server Management Studio
  2. ดูที่ Object Explorer (ด้านซ้าย)
  3. เลือกโฟลเดอร์ >> Security >> Logins
  4. เลือก User ที่ใช้งานอยู่ คลิกขวาเลือกเมนูลัด “Properties”
  5. เมื่อขึ้นหน้าต่าง ดูที่ Select a page (ด้านซ้าย)
  6. เลือก Server Role ให้ Check “sysadmin” กดปุ่ม Ok

เป็นอีกหนึ่งวิธีที่แก้ไข้ได้ครับ เรียบร้อยโรงเรียนไทย

Bookmark and Share

การติดตั้ง pear ใน php5

บันทึกโดย TaTump วันที่ 23 April 2010 | 129 views
  • เข้าไปที่ Directory ที่ติดตั้ง php (กรณี Appserv จะเป็น C:\AppServ\php5)
  • แล้ว double click ไฟล์ go-pear.bat แล้วทำตามขั้นตอนตามที่เห็นบนหน้าจอเลยครับ (กด Enter ไปเรื่อยๆ)
  • เมื่อติดตั้งเสร็จแล้วในโฟลเดอร์ PEAR จะมีไฟล์ต่างๆเพิ่มเข้ามา เป็นอันเสร็จพิธี
Bookmark and Share

Client for Google Translate

บันทึกโดย TaTump วันที่ 23 April 2010 | 135 views

Client for Google Translate

โปรแกรม Google Translate สำหรับเครื่อง Client มีฟังก์ชั่นทั้งแบบกรอกเอง หรือจะเลือก text ก็จะมี pop up เด้งขึ้นมาพร้อมคำแปลให้เราทันที แสนสะดวกมากมาย

Download : http://translateclient.com/

Bookmark and Share

ฟังก์ชั่น javascript แปลงเลขทศนิยมเป็นเปอร์เซนต์

บันทึกโดย TaTump วันที่ 14 April 2010 | 131 views

Script : Convert decimal to percent.

function convertDecimalToPercent(Decimal) {
 Percent =  (Decimal * 100);
 return Percent.toFixed(2);
}
Bookmark and Share

Firefox Add-ons Domain Details

บันทึกโดย TaTump วันที่ 4 April 2010 | 101 views

Add-ons-for-Firefox-Domain-Details

ประโยชน์ของ Add-ons ตัวนี้คือไว้ แสดง Server Type, Headers, IP Address, Location Flag, และลิงค์ไป Whois Reports. ส่วนตัวผมชอบฟังก์ชั่น Copy IP และ Whois Reports ครับ

Download: https://addons.mozilla.org/en-US/firefox/addon/2166

Bookmark and Share

Firefox Add-ons Google Shortcuts

บันทึกโดย TaTump วันที่ 2 April 2010 | 122 views

Firefox-Add-ons-Google-Shortcuts

ผมเป็นคนใช้บริการ Google บ่อย เช่น Gmail , Gmap  หรือ Google Translates พอดีไปเจอ Add-ons ตัวนี้ โดยมันจะสร้าง Shortcuts บริการของ Google ทั้งหมดไว้ให้ (เราสามารถเลือกบริการให้แสดงได้) ต่อไปเวลาเข้าบริการของ Google ก็ไม่ต้องพิมพ์ หรือ Bookmark ให้เสียเวลาแล้ว

Download: https://addons.mozilla.org/en-US/firefox/addon/3576

Bookmark and Share

คำสั่ง SQL Copy ข้อมูล Columnนึง ไปใส่อีก Columnนึง

บันทึกโดย TaTump วันที่ 16 November 2009 | 484 views
UPDATE TableName SET FieldName1 = FieldName2

จาก sql ด้านบนคือ copy ข้อมูลใน FieldName2 ไปใส่ FieldName1

Bookmark and Share

Page 2 of 15«12345»...Last »