My Personal Blog's
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: ASP.NET, c#, converter, csharp, datatable, datatable to json, datatable to json converter, json, json converter
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 [...]
Collapsible Drag & Drop Panels like WordPress Dashboard using Jquery and ASP.NET
April 25, 2011 - 4:02 pm
Tags: Collapsible Drag & Drop, Collapsible Drag & Drop Panels, Collapsible Drag & Drop Panels like Wordpress, Collapsible Drag & Drop Panels like Wordpress Dashboard using Jquery and ASP.NET, Drag & Drop Panels like Wordpress, Drag & Drop Panels like Wordpress Dashboard using Jquery, jquery Collapsible, Jquery dashboard, save state panel using asp.net, Wordpress Dashboard
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 [...]
VB.NET – ASP.NET communication between user control and web page using event handler
April 21, 2011 - 5:09 pm
Tags: ascx, ASP.NET, Event Driven Communication, event handler, eventargs, EventHandler, handler, handles, raise event, raiseevent, user control, VB.NET, VB.NET - ASP.NET communication between user control and web page using event handler
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 [...]
Fun with Pic Scatter for Facebook Profile
January 8, 2011 - 10:06 pm
Tags: Facebook, Fun with Pic Scatter for Facebook Profile, Pic Scatter, PicScatter, Profile
Posted in Website Review, Website Tips n Trick | No comments
ILight Marina Bay Singapore
November 8, 2010 - 7:33 pm
Tags: ILight, ILight Marina Bay Singapore, Marina Bay, Singapore
Posted in My Photo Fun | No comments
ASP.NET – GridView – Get Hidden Field Value in RowCommand
September 21, 2010 - 5:12 pm
Tags: ASP.NET - GridView - Get Hidden Field Value in RowCommand, Get Hidden Field Value, Get Hidden Field Value in RowCommand, gridview, RowCommand
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") [...]
Ask for username and password when calling reporting service
June 22, 2010 - 10:42 am
Tags: Ask for username and password, Ask for username and password when calling reporting service, GetFormsCredentials, how to set credentials for reporting services, keep asking for username and password when calling reporting services, NetworkCredentials, pop up authentication when calling reporting service, reporting service
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 [...]
Get first day of the month and last day of the month in VB.NET
June 3, 2010 - 4:31 pm
Tags: Finding the first and last day of the month, first day of the month, Get first day of the month and last day of the month in VB.NET, last day of the month, VB.NET
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, [...]
VB.NET Set Data Table to CSV File
June 3, 2010 - 4:22 pm
Tags: Data Table to CSV, datatable 2 csv, DataTable to CSV, Set Data Table to CSV File, VB.NET, VB.NET Set Data Table to CSV File
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 [...]



