Pages

Monday, September 16, 2013

How to import Huge SQL Script on mysql

open xampp Control Panel
click / open : shell

on shell type this commands:

1. command : "MYSQL -U USERNAME -H LOCALHOST -P PASSWORD"
USERNAME : your database username
PASSWORD : your database password
(if no password, then don't use "-P PASSWORD")

2. command : "USE NAME_OF_DATABASE"
 NAME_OF_DATABASE : name of your database

3. command : "SOURCE PATH_TO_SQL_FILE"
PATH_TO_SQL_FILE : location to script.sql
(ex. "source d:/myscript.sql")

4. done

Thursday, September 12, 2013

Firefox Text Bold Problem

I got my Firefox Text get Bold. This problem caused by regular Arial Font is missing. So, Arial Black is used.
To fix this, I got arial.ttf from http://www.fontsupply.com/fonts/A/Arial.html .
After you download, open arial.zip then open arial.ttf. Click install.
Your arial font will installed.
Problem done.

Tuesday, June 4, 2013

Creating ASPNET WebForm GridView Paging

Here is code for Creating ASPNET WebForm GridView Paging :

On *.aspx files, gridview need : properties AllowPaging and events OnPageIndexChanging
You can set and configure the pager style & setting by changing the PagerStyle and PagerSettings.

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"  OnPageIndexChanging="GridView1_PageIndexChanging>
        <PagerStyle HorizontalAlign="Center" CssClass="foo" />
        <PagerSettings Mode="NumericFirstLast" PageButtonCount="5" FirstPageText="First" LastPageText="Last" />
</asp:GridView>

protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
        GridView1.PageIndex = e.NewPageIndex;
        LoadData();
}

private void LoadData()
{
        GridView1.DataSource = mylist.ToList();
        GridView1.DataBind();
}

LoadData is a function to bind list or array to GridView. 
We can Manage the list by put them in a ViewState or in a Session to Keep Consistent List.
This could happend when you have searched list or sorted it.

Friday, March 8, 2013

SQL Server Rename Table Name

To rename table name in SQL Server , you can use this store procedure:
SP_RENAME 'TABLE_NAME' , 'NEW_TABLE_NAME' .
For example: sp_rename 'TFileFolder' , 'TFolder'
 

Saturday, February 11, 2012

CompiledQuery Linq to SQL C#

using CompiledQuery Linq to SQL C# using CompiledQuery can do more good performance and more efficient.
 using System.Data.Linq;
 public static Func> userData
        = CompiledQuery.Compile((myDataContext db) => db.TableUsers);

Using StopWatch to Count Execution Time in ASP.NET

Using Stopwatch to Count Execution Time in ASP.NET

 using System.Diagnostics;
 Stopwatch sw = new Stopwatch(); //create object
 sw.Start(); // start the stopwatch
 //do something here
 sw.Stop(); // stop the stopwatch
 Console.WriteLine("Time elapsed : " + sw.ElapsedMilliseconds.ToString());

Thursday, February 9, 2012

Make calendar events on ASP.NET

Make calendar events on ASP.NET

  • Drag Calendar Control to Your WebForm
  • Choose Event Menu
  • Find DayRender
  • Double Click

//Here's the codes
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    List dt = new List();
    for (int i = 0; i < 5; i++)
    {
        DateTime myevent = new DateTime(2012,02,2+2*i);
        dt.Add(myevent);
    }

    foreach (var item in dt)
    {
        if (e.Day.Date == item)
        {
            e.Cell.ForeColor = Color.White;
            e.Cell.BackColor = Color.BlueViolet;
            e.Cell.Text = e.Day.DayNumberText;
            e.Cell.ToolTip = "tooltip untuk tgl " + e.Day.DayNumberText;
        }
    }
}

Saturday, January 21, 2012

YM Online Status

Show YM Online Status
<img src="http://opi.yahoo.com/online?u=ymID&m=g&t=1" />

example :
<img src="http://opi.yahoo.com/online?u=ardi_ardianto_z&m=g&t=1" />



different number (t=number) will change the image
<img src="http://opi.yahoo.com/online?u=ardi_ardianto_z&m=g&t=12" />

Yahoo Messenger Chat using HTML

How to chat YM using HTML
<a href="ymsgr:sendIM?ymID">chat</a>
example
<a href="ymsgr:sendIM?ardi_ardianto_z">chat with Ardi</a>

Wednesday, September 7, 2011

Delete Folder and Subfolder

click start >> run >> fill " cmd " in the blank then enter or click OK
then write these :

  • rd\\.\directory:\foldername /s
eg. rd\\.\e:\autorun.inf /s
then, type y and press ENTER
note :if you want do this without confirmation, add /q to the command
eg. rd\\.\e:\autorun.inf /s /q

ShareThis