บทความ

กำลังแสดงโพสต์จาก 2016

Simple markers Google Map API with C# .Net

รูปภาพ
  Simple markers Google Map API with C#  ปักหมุดลงใน Google Map โดยนำข้อมูลจาก C#  สามารถเปลี่ยนหมุดได้ตามที่เรากำหนดเลย C# CodeFile map.aspx.cs string sql = "SELECT  Latitude, Longitude,markericons FROM table"; SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds, "Result"); //ข้อมูลจาก Sql server List<String> oGeocodeList= new List<String>(); List<String> MarkerIcon = new List<String>();  for (int i = 0; i < ds.Tables["Result"].Rows.Count; i++){                    oGeocodeList.Add(" '" + ds.Tables["Result"].Rows[i]["Latitude"].ToString() + "," + ds.Tables["Result"].Rows[i]["Longitude"].ToString() + "' "); MarkerIcon.Add(" '" + ds.Tables["Result"].Rows[i]["markericons"].ToString() + "' "); } String geocodevalues= String.Join("...

DropDown List Background Color C# ASP.NET

รูปภาพ
มาใส่สีพื้นหลังให้กับ DropDown List  ให้มีสีสันสวยงามกันดีกว่าครับ ตัวอย่างการใช้งาน Code-Behind (C#)   AspNetCodeBehind.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AspNetCodeBehind.aspx.cs" Inherits="AspNetCodeBehind" %> <html> <head> <   title> DropDownList Background  Color ASP.NET</title> </head> <body>     <form id="form1" runat="server">     <div class="input-group">                               <span class="input-group-addon" id="basic-addon-zonecolor">เลือกสี</span>                               <asp:DropDownList ID="ddlMultiColor" runat="server"  OnSelectedIndexChanged="ddlMultiColor_OnSelectedIndexChanged"                     ...

SQL Server เมื่อหยุดใช้ is not null กับผลที่ตามมา

รูปภาพ
เวลาใช้คำสั่งคิวรี่ต่างๆ ทำไมบางทีถึงรู้สึกว่ามันช้านะ ลองเช็คดูมีคำสั่ง is not null เต็มเลย ใช้เวลาคิวรี่ 10-20 วินาทีต่อคำสั่งเลย หยุดใช้แล้วเปลี่ยนมาเป็น  isnull ( name , '' ) <>  '' ถ้าเป็น int ก็สามารถปรับเปลี่ยนได้ เช่น  isnull (int , 0 ) <> 0 ลองมาดูกัน  Select Top 10000 ใช้เวลา 9 วินาทีเลย มาดูแบบไม่ใช้บ้าง เหลือแค่ 4 วินาทีเท่านั้น สุดยอดเลย มาดูที่เป็น varchar บ้าง ทำไปได้ 31 วินาที ลองปรับไม่ใช้ เหลือแค่ 14 วินาทีเท่านั้นหายไปมากกว่า 50 % เลย เห็นแบบนี้แล้วต้องลองเปลี่ยนมาใช้กันดูครับ แต่จะเร็วจะช้าก็ขึ้นอยู่กับ server และการใช้งานในขณะนั้นด้วยนะครับ

ASP.NET Hello World

ASP.NET Hello World  ทดสอบการทำงานของ Web Server และ .NET Framework ด้วยการแสดงคำว่า Hello World  C# ครับ <%@ Page Language="C#" %> <script runat="server"> public void Page_Load(object sender, EventArgs e) {        lblText.Text = "Hello World"; } </script> <html> <head>     <title>ASP.NET Hello World</title> </head> <body> <form id="formHello" runat="server"> <asp:Label id="lblText" runat="server"></asp:Label> </form> </body> </html> VB ครับ <%@ Page Language="VB" %> <script runat="server">     Sub Page_Load(sender As Object, e As EventArgs)  lblText.Text = "Hello World" End Sub </script> <html> <head>     <title>ASP.NET Hello World</title> </head> <body> <form id="formHello" runat=...