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'
 

ShareThis