How to Create Temporary Table
Step 1 : add the below function
public
DataTable
CreateTable()
{
DataTable
odtReviews = new
DataTable();
odtReviews.Columns.Add("ReviewDate",
typeof(string));
odtReviews.Columns.Add("PostedBy",
typeof(string));
odtReviews.Columns.Add("Content",
typeof(string));
odtReviews.Columns.Add("Rating",
typeof(string));
return
odtReviews;
}
step
2 : create object of above datatable
DataTable
odtReviews = CreateTable();
step
3 : create datarow
DataRow
odr;
odr
= odtReviews.NewRow();
(or)
DataRow
odr=odtReviews.NewRow();
Step
4 : assign the values
odr["ReviewDate"]
= "11-Aug-2012";
.
.
.
step
5 : add datarow into datatable
odtReviews.Rows.Add(odr);
Comments
Post a Comment