admin

This user hasn't shared any biographical information


Posts by admin

[Asp.net] Convert datatable to Json

February 22, 2013 - 12:11 pm

Tags: , , , , , , , ,
Posted in ASP.NET | No comments

This code is used to convert datatable to json format. It also handle double quote and backslash issue. public static string Convert(DataTable dt) { string sb = ""; sb += "["; foreach (DataRow dr in dt.Rows) { sb += "{"; foreach (DataColumn dc in dt.Columns) { //Column Name sb += "\""; sb += dc.ColumnName; sb [...]

  • Share/Bookmark

Collapsible Drag & Drop Panels like WordPress Dashboard using Jquery and ASP.NET

April 25, 2011 - 4:02 pm

Tags: , , , , , , , , ,
Posted in ASP.NET | No comments

I found a great article that teach us how to create drag and drop panel like dashboard in wordpress panel. In this sites: http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/ shows us how to create the drag and drop panel and save the state in PHP and mysql. In this article, I will show the code in ASP.NET using SQL Server [...]

  • Share/Bookmark

VB.NET – ASP.NET communication between user control and web page using event handler

April 21, 2011 - 5:09 pm

Tags: , , , , , , , , , , , ,
Posted in ASP.NET | No comments

In this post, we want to show how button in user control communicate with web page in asp.net First create user control called button.ascx. Add 3 button, name it btnSave, btnEdit and btnCancel. in button.ascx back code, add this code: Public Partial Class button Inherits System.Web.UI.UserControl Public Event btnSaveHandler As System.EventHandler Public Event btnEditHandler As [...]

  • Share/Bookmark

Fun with Pic Scatter for Facebook Profile

January 8, 2011 - 10:06 pm

Tags: , , , ,
Posted in Website Review, Website Tips n Trick | No comments

Check this cool website tools to make your facebook profile picture more killer. Website: http://picscatter.com/

  • Share/Bookmark

ILight Marina Bay Singapore

November 8, 2010 - 7:33 pm

Tags: , , ,
Posted in My Photo Fun | No comments

Lumenocity Singapore

  • Share/Bookmark

ASP.NET – GridView – Get Hidden Field Value in RowCommand

September 21, 2010 - 5:12 pm

Tags: , , , ,
Posted in ASP.NET, VB.NET | No comments

There is a problem when we set BoundField visibility to false, the column isn’t rendered to the client. A work around would be to use a HiddenField within a TemplateField instead. <asp:TemplateField HeaderText="MemberID"> <ItemTemplate> <asp:LinkButton ID="lbtn_memberid" runat="server" CommandName="GetMemberID" CommandArgument=’<%# DataBinder.Eval(Container, "DataItem.memberid") %>’ Text=’<%# DataBinder.Eval(Container, "DataItem.memberid") %>’></asp:LinkButton> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:HiddenField ID="fieldid" runat="server" Value=’<%# Eval("fieldname") [...]

  • Share/Bookmark

Ask for username and password when calling reporting service

June 22, 2010 - 10:42 am

Tags: , , , , , , ,
Posted in Reporting Services | 1 comment

These code allow us to set username and password for reporting services to avoid popup request authentication. This code tested in Visual Studio 2008 and Reporting Services from SQL Server 2005 First create a class called ReportServerCredentials.vb Imports Microsoft.VisualBasic Imports Microsoft.Reporting.WebForms Imports System.Security.Principal Public NotInheritable Class ReportServerCredentials Implements IReportServerCredentials Public ReadOnly Property ImpersonationUser() As WindowsIdentity [...]

  • Share/Bookmark

Send Email with multiple attachments from VB.NET

June 3, 2010 - 4:43 pm

Tags: , , , , ,
Posted in VB.NET | No comments

This code show how to send email multiple attachments from vb.net by using System.Net.Mail 1. This is how you use it Dim fileAttch = New ArrayList fileAttch.Add("C:\test.csv") fileAttch.Add("C:\test2.csv") fileAttch.Add("C:\test3.csv") sendEmail.send(your_emailHost, "no-reply@company.com", your_EmailTo, your_EmailSubject, your_EmailBody, your_EmailccTo, fileAttch)

  • Share/Bookmark

Get first day of the month and last day of the month in VB.NET

June 3, 2010 - 4:31 pm

Tags: , , , ,
Posted in VB.NET | 1 comment

This code show how to get first date of the month and last day of the month date. Private Function GetFirstDayOfMonth(ByVal dtDate As DateTime) As DateTime Dim dtFrom As DateTime = dtDate dtFrom = dtFrom.AddDays(-(dtFrom.Day – 1)) Return dtFrom End Function Private Function GetLastDayOfMonth(ByVal dtDate As DateTime) As DateTime Dim dtTo As New DateTime(dtDate.Year, dtDate.Month, [...]

  • Share/Bookmark

VB.NET Set Data Table to CSV File

June 3, 2010 - 4:22 pm

Tags: , , , , ,
Posted in VB.NET | 1 comment

This function show how to Convert DataTable to CSV File Sub SetDataTable_To_CSV(ByVal dtable As DataTable, ByVal path_filename As String, ByVal sep_char As String) Dim writer As System.IO.StreamWriter Try writer = New System.IO.StreamWriter(path_filename) Dim _sep As String = "" Dim builder As New System.Text.StringBuilder For Each col As DataColumn In dtable.Columns builder.Append(_sep).Append(col.ColumnName) _sep = sep_char Next [...]

  • Share/Bookmark