February 2010
M T W T F S S
« Dec    
1234567
891011121314
15161718192021
22232425262728

Send SqlDbType.Xml to Store Procedure

SqlCommand command = new SqlCommand(”ReportMultiTruckGeneric”);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(”@startDate”, SqlDbType.DateTime).Value = ProcessStartDate;
command.Parameters.Add(”@endDate”, SqlDbType.DateTime).Value = ProcessEndDate;

StringBuilder sb = new StringBuilder();

sb.Append(”<Trucks>”);
foreach (DataRow row in trucks.Tables[0].Rows)
{
sb.AppendFormat(”<TruckId>{0}</TruckId>”, row["ID"].ToString());
}
sb.Append(”</Trucks>”);

command.Parameters.Add(”@trucks”, SqlDbType.Xml).Value = sb.ToString();

DataSet queryResult = DBHook.SendSQLSelectRequest(command, out ex);

==store procedure=============
ALTER procedure [dbo].[ReportMultiTruckGeneric]
@startDate datetime,
@endDate datetime,
@trucks xml
as


set @trucksCopy = @trucks

select Trucks.TruckId.value(’.', ‘int’)
from @trucksCopy.nodes(’Trucks/TruckId’) as Trucks(TruckId)

What is Google Public DNS?

http://code.google.com/intl/th-TH/speed/public-dns/

ไปตั้งค่า DNS เป็น 8.8.8.8 กับ 8.8.4.4 นะครับ ผลคือเน็ตผมเร็วขึ้นกว่าเดิมมากๆเลย

Multi Thread and Delegate

จากรูปข้างล่างนี้เราสามารถที่จะเลือกใส่ทั้ง IP Address , HostName, DNS เพื่อทำการ Ping ได้ครับ

http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&id=21512

http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&id=21512

http://greatfriends.biz/webboards/msg.asp?id=16216

New line in crystal report formular

chr(13)

Test syntax hilighter

class=”brush: c-sharp; ”

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
    /* test hilighter */
    class ClassAddress
    {
        public string Name { get; set; }
        public string Street1 { get; set; }
        public string Street2 { get; set; }
        public string CityName { get; set; }
        public string StateOrProvince { get; set; }
        public string CountryName { get; set; }
        public string PostalCode { get; set; }
    }
}

class=”brush: php; html-script: true”—–
class=”brush: css; html-script: true”

.class1{
   background-color: Red !important;
}

class=”brush: csharp; html-script: true”

Visual Studio Programmer Themes Gallery

image

See more themes goto link below

http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx
http://blog.wekeroad.com/2007/10/17/textmate-theme-for-visual-studio-take-2/

Problem with searching thai text in ms sql

Try this :

Select * from Table1 WHERE (ColumnName like N’%Values%’)

Select * from Table1 WHERE (ColumnName = N’%Values%’)

or

Select * from Table1 Where (ColumnName collate Thai_bin like N’%Values%’)

Select * from Table1 Where (ColumnName collate Thai_bin = N’%Values%’)

Format number in gridview

<asp:BoundField DataField=”prodPrice” HeaderText=”Price” HtmlEncode=”False” DataFormatString=”{0:f0}” />

Or in TemplateField

<asp:TemplateField HeaderText=”Price”>
<ItemTemplate>
<%#Eval(“prodPrice”,”{0:f0}”)%>
</ItemTemplate>
</asp:TemplateField>

Ex: {0:f0} is integer, {0:f1} is decimal with  1 digit

Google Wave

Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in the Internet zone.

1. In the Internet Explorer, “Tools” Menu, select “Internet Options”.

2. Switch to “Security” Tab.

3. Click on “Internet” (The Globe Icon. Its actually the default selected).

4. Click on “Custom Level” in the bottom.

5. Scroll down to find the “User Authentication” section.

6. Select “Automatic logon with current username and password”.

7. Click “Ok” twice to exit.

ref:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vsdebug.asp