NGÀY TRỞ LẠI??

Người đăng: chisenhungsuutam on Thứ Ba, 18 tháng 11, 2014

Bỏ bẵng đi 1 thời gian do bận việc này việc khác, cũng bỏ quên không vào chăm sóc viết bài cho cái blog này. Tình hình nay quay lại vẫn thấy nhiều bạn ghé vào thường xuyên để ngâm cứu, cũng thấy vui vui.

Dự tính thời gian tới lại cày kéo tiếp không thì kiến thức nó mai một đi hết thì phí. Mình thấy số lượng các bạn quan tâm tới Cocos2d-x cũng ngày càng tăng lên đáng kể, mới làm quen lập trình game cũng có, chuyển đổi từ engine - ngôn ngữ khác sang cũng có, nhưng túm lại là có phát triển. Tương lai của Engine này không biết tới đâu vì còn tùy thuộc vào Team phát triển của nó ( đang phát triển 3.3 - 3.4 rồi), nhưng chắc chắn cũng đang có nhiều người quan tâm. Càng đông càng vui nhỉ. Và sẽ học hỏi được nhiều điều hơn.

Không biết từ Blog này có bạn nào đã tạo được dự án nào chưa? Mềnh cũng ủ làm vài cái nho nhỏ cho vui, mà giờ trượt tiến độ quá, hix. Chắc phải cày lại thôi

Đôi lời cùng những ai đang ghé qua đây, hi vọng sẽ trở lại sớm sớm!


More about

Cài đặt: Hướng dẫn cài đặt MS SQL Server 2008 (bằng hình ảnh)

Người đăng: chisenhungsuutam on Thứ Hai, 3 tháng 11, 2014

Bước 1. Bạn vào đây để tải về bộ cài đặt SQL Server 2008 Express Edition.

Bước 2. Click đúp vào file cài đặt, chờ trong giây lát bạn sẽ thấy màn hình sau

Bước 3. Click vào Installation ở cửa sổ bên trái. Sau đó, màn hình sẽ hiển thị ra các lựa chọn. Bạn chọn New SQL Server stand-alone installation or add features to an existing installation ở cửa sổ bên phải.

Bước 4. Sau khi lựa chọn Bước 3, sẽ có một cửa sổ xuất hiên như bên dưới, nhấn Run Program để tiếp tục.

Bước 5. Trong vài phút chương trình sẽ kiểm tra các điều kiện cần thiết để chuẩn bị cho quá trình cài đặt. Khi kiểm tra xong, bạn nhấn Ok để tiếp tục.
Bước 6. Nếu bạn cài bản SQL Express Editon thì nhấn Next để bỏ qua bước này. Nếu là phiên bản khác bạn nhập Key vào mục Enter the Product key. Sau đó, nhấn Next để tiếp tục.
Bước 7. Đánh dấu vào mục I accept the License term để đồng ý với các điều khoản của Microsoft. Sau đó, nhấn Next để tiếp tục.

Bước 8. Click Install để cài đặt một số file cần thiết.

Bước 9. Quá trình cài đặt tiếp tục kiểm tra những thành phần cần thiết cho việc cài đặt. Nhấn Next để tiếp tục.
Bước 10. Ở bước này, lựa chọn những tính năng cần thiết bạn muốn cài đặt bằng cách đánh dấu chọn trước các mục. Sau đó, nhấn Next để sang bước tiếp theo.

Bước 11. Bước này, bạn cần chọn tên và ID đại diện (Instance ID). Các bạn có thể chọn mặc định như hình dưới hoặc chọn khác theo ý thích của mình. Nhấn Next để tiếp tục

Bước 12. Một cửa sổ xuất hiện và thông báo dung lượng cần thiết để quá trình cài đặt được tiến hành. Nhấn Next để tiếp tục.
Bước 13. Lựa chọn tên tài khoản từ danh sách Drop Down List cho SQL Server Database Engine. Sau đó, nhấn Next để tiếp tục

Bước 14. Lựa chọn chế độ mà bạn muốn sử dụng. Có 2 chế độ:
- Windows Authentication Mode: Chế độ xác thực tài khoản theo quyền sử dụng của tài khoản hệ thống (Windows)
- Mixed Mode: Xác thực tài khoản theo phân quyền của tài khoản SQL Server
Sau khi lựa chọn, nhấn Next để tiếp tục

Bước 15. Click Next để tiếp tục.

Bước 16. Quá trình kiểm tra các hoạt động cần thiết cho cài đặt. Bước này nếu hoạt động cần thiết nào bị lỗi, tiến trình cài đặt có thể không được bắt đầu. Nhấn Next để tiếp tục.

Bước 17. Quá trình cài đặt đã sẵn sàng. Chọn Install để bắt đầu cài đặt.

Bước 18. Cài đặt hoàn tất, bạn sẽ thấy thông báo sau. Nhấn Next để kết thúc.
Bước 19. Nhấn Close để kết thúc quá trình cài đặt

Tags: Cài đặt, hướng dẫn, SQL Server, SQL Server 2008, SQL Server 2008 FULL, SQL Server 2008 Express Edition, Setup, Install, Step by step.


More about

ASP.NET: Thêm mới, cập nhật, xóa dữ liệu trên GridView

Người đăng: chisenhungsuutam


1. Tạo bảng customers trong cơ sở dữ liệu CustomerManage với các trường và kiểu dữ liệu sau:

2. Cấu hình tập tin web.config:
<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5"/>
      <httpRuntime targetFramework="4.5"/>
    </system.web>
  <connectionStrings>
    <add  name="conn" connectionString="Data Source=hiennm;Initial Catalog=CustomerManage;Integrated Security=True"/>
  </connectionStrings>
</configuration>

3. Tập tin Default.aspx (Thiết kế giao diện)
<head runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="dvGrid" style="padding:10px; width:550px">
<asp:GridView ID="GridView1" runat="server"  Width = "550px"
AutoGenerateColumns = "false" Font-Names = "Arial"
Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69A"
HeaderStyle-BackColor = "blue" AllowPaging ="true"  ShowFooter = "true"
OnPageIndexChanging = "OnPaging" onrowediting="EditCustomer"
onrowupdating="UpdateCustomer"  onrowcancelingedit="CancelEdit"
PageSize = "10" >
<Columns>
<asp:TemplateField ItemStyle-Width = "30px"  HeaderText = "CustomerID">
    <ItemTemplate>
        <asp:Label ID="lblCustomerID" runat="server"
        Text='<%#Eval("CustomerID")%>'></asp:Label>
    </ItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="txtCustomerID" Width = "40px"
            MaxLength = "5" runat="server"></asp:TextBox>
    </FooterTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width = "100px"  HeaderText = "Name">
    <ItemTemplate>
        <asp:Label ID="lblContactName" runat="server"
                Text='<%#Eval("ContactName")%>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox ID="txtContactName" runat="server"
            Text='<%#Eval("ContactName")%>'></asp:TextBox>
    </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="txtContactName" runat="server"></asp:TextBox>
    </FooterTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width = "150px"  HeaderText = "Company">
    <ItemTemplate>
        <asp:Label ID="lblCompany" runat="server"
            Text='<%#Eval("CompanyName")%>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox ID="txtCompany" runat="server"
            Text='<%#Eval("CompanyName")%>'></asp:TextBox>
    </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="txtCompany" runat="server"></asp:TextBox>
    </FooterTemplate>
</asp:TemplateField>
<asp:TemplateField>
    <ItemTemplate>
        <asp:LinkButton ID="lnkRemove" runat="server"
            CommandArgument = '<%#Eval("CustomerID")%>'
         OnClientClick = "return confirm('Do you want to delete?')"
        Text = "Delete" OnClick = "DeleteCustomer"></asp:LinkButton>
    </ItemTemplate>
    <FooterTemplate>
        <asp:Button ID="btnAdd" runat="server" Text="Add"
            OnClick = "AddNewCustomer" />
    </FooterTemplate>
</asp:TemplateField>
<asp:CommandField  ShowEditButton="True" />
</Columns>
<AlternatingRowStyle BackColor="#C2D69A"  />
</asp:GridView>
</div>
</form>
</body>
</html>

4. File Default.aspx.cs (Mã nguồn C#)
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Data;
usingSystem.Data.SqlClient;
usingSystem.Configuration;

public partial class Insert_Update_Delete: System.Web.UI.Page
{
    private StringstrConnString = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
    private voidBindData(){
        stringstrQuery = "select CustomerID,ContactName,CompanyName" +
                           " from customers";
        SqlCommandcmd = new SqlCommand(strQuery);
        GridView1.DataSource = GetData(cmd);
        GridView1.DataBind();
    }
    private DataTableGetData(SqlCommand cmd){
        DataTabledt = new DataTable();
        SqlConnectioncon = new SqlConnection(strConnString);
        SqlDataAdaptersda = new SqlDataAdapter();
        cmd.CommandType = CommandType.Text;
        cmd.Connection = con;
        con.Open();
        sda.SelectCommand = cmd;
        sda.Fill(dt);
        returndt;
    }
  
    protected voidPage_Load(object sender, EventArgse){
        if(!IsPostBack)
        {
            BindData();
        }
    }
    protected voidAddNewCustomer(object sender, EventArgse){
        stringCustomerID = ((TextBox)GridView1.FooterRow.FindControl("txtCustomerID")).Text;
        stringName = ((TextBox)GridView1.FooterRow.FindControl("txtContactName")).Text;
        stringCompany = ((TextBox)GridView1.FooterRow.FindControl("txtCompany")).Text;
        SqlConnectioncon = new SqlConnection(strConnString);
        SqlCommandcmd = new SqlCommand();
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "insert into customers(CustomerID, ContactName, CompanyName) "+
        "values(@CustomerID, @ContactName, @CompanyName);" +
        "select CustomerID,ContactName,CompanyName from customers";
        cmd.Parameters.Add("@CustomerID", SqlDbType.VarChar).Value = CustomerID;
        cmd.Parameters.Add("@ContactName", SqlDbType.VarChar).Value = Name;
        cmd.Parameters.Add("@CompanyName", SqlDbType.VarChar).Value = Company;
        GridView1.DataSource = GetData(cmd);
        GridView1.DataBind();
    }
    protected voidEditCustomer(object sender, GridViewEditEventArgse)
    {
        GridView1.EditIndex = e.NewEditIndex;
        BindData();
    }
    protected voidCancelEdit(object sender, GridViewCancelEditEventArgse)
    {
        GridView1.EditIndex = -1;
        BindData();
    }
    protected voidUpdateCustomer(object sender, GridViewUpdateEventArgse)
    {
        stringCustomerID = ((Label)GridView1.Rows[e.RowIndex]
                            .FindControl("lblCustomerID")).Text;
        stringName = ((TextBox)GridView1.Rows[e.RowIndex]
                            .FindControl("txtContactName")).Text;
        stringCompany = ((TextBox)GridView1.Rows[e.RowIndex]
                            .FindControl("txtCompany")).Text;
        SqlConnectioncon = new SqlConnection(strConnString);
        SqlCommandcmd = new SqlCommand();
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "update customers set ContactName=@ContactName," +
         "CompanyName=@CompanyName where CustomerID=@CustomerID;" +
         "select CustomerID,ContactName,CompanyName from customers";
        cmd.Parameters.Add("@CustomerID", SqlDbType.VarChar).Value = CustomerID;
        cmd.Parameters.Add("@ContactName", SqlDbType.VarChar).Value = Name;
        cmd.Parameters.Add("@CompanyName", SqlDbType.VarChar).Value = Company;
        GridView1.EditIndex = -1;
        GridView1.DataSource = GetData(cmd);
        GridView1.DataBind();
    }
    protected voidDeleteCustomer(object sender, EventArgse)
    {
        LinkButtonlnkRemove = (LinkButton)sender;
        SqlConnectioncon = new SqlConnection(strConnString);
        SqlCommandcmd = new SqlCommand();
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "delete from  customers where "+
        "CustomerID=@CustomerID;"+
         "select CustomerID,ContactName,CompanyName from customers";
        cmd.Parameters.Add("@CustomerID", SqlDbType.VarChar).Value
            = lnkRemove.CommandArgument;
        GridView1.DataSource = GetData(cmd);
        GridView1.DataBind();
    }
    protected voidOnPaging(object sender, GridViewPageEventArgse)
    {
        BindData();
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.DataBind();
    }
}
Tags: Asp.net, asp, mvc, gridview, vs 2013, visual studio, mfc, c#, vb.net
More about