 |
|
ต้องการทำ PAGING ของ gridview ครับแต่ติดปัญหา Object reference not set to an instance of an object |
|
 |
|
|
 |
 |
|
Code (C#)
AppenSqL = new StringBuilder();
AppenSqL.Append("SELECT IdDoc,TypeDoc,CreateBy,Subjects,Keywords,Status,UploadDate,UploadBy,Pathfile FROM Compliance_Document WHERE ");
if (chkDate == true)
{
AppenSqL.Append("(UploadDate between '" + begindate3 + "' and '" + afterdate3 + "')");
multiCri = true;
}
//ADD CRITERIA DOCUMENT TYPE
if (chkType == true)
{
if (multiCri == true)
{
AppenSqL.Append("and (TypeDoc='" + DropDownList1.SelectedValue.ToString() + "')");
}
else
{
AppenSqL.Append("(TypeDoc= '" + DropDownList1.SelectedValue.ToString() + "')");
multiCri = true;
}
}
//ADD CRITERIA DOCUMENT CREATEBY
if (chkCreate == true)
{
if (multiCri == true)
{
AppenSqL.Append(" and (CreateBy = '" + DropDownList2.SelectedValue.ToString() + "')");
}
else
{
AppenSqL.Append("(CreateBy ='" + DropDownList2.SelectedValue.ToString() + "')");
multiCri = true;
}
}
//ADD CRITERIA DOCUMENT SUBJECT
if (chkSubject == true)
{
if (multiCri == true)
{
AppenSqL.Append(" and (Subjects like'" + "%" + txtSubject.Text + "%" + "')");
}
else
{
AppenSqL.Append("(Subjects like'" + "%" + txtSubject.Text + "%" + "')");
multiCri = true;
}
}
|
 |
 |
 |
 |
Date :
2010-11-16 11:20:55 |
By :
taekungza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้ส่วนของ PAGING
Code (C#)
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridBind();
}
|
 |
 |
 |
 |
Date :
2010-11-16 11:22:29 |
By :
taekungza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|