Monday, May 30, 2011
Sunday, May 29, 2011
How to create dynamic GRID VIEW in asp.net
public void loaddynamicgrid()
{
DataTable dt = new DataTable();
DataColumn dc;
DataRow dRow;
dc = new DataColumn("Date", typeof(DateTime));
dt.Columns.Add(dc);
dc = new DataColumn("Name", typeof(Int64));
dt.Columns.Add(dc);
SqlDataAdapter da = new SqlDataAdapter("select * from Tbl_Emp", Sqlconnectionstring);
DataSet ds = new DataSet();
da.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
dRow = dt.NewRow();
dt.Rows.Add(dRow);
dt.Rows[i][0] = ds.Tables[0].Rows[i]["date"].ToString();
dt.Rows[i][1] = ds.Tables[0].Rows[i]["name"].ToString();
}
}
How to add dynamic footer in dynamic Grid View with ASP.NET
This code use after Binding a gridview.
GridViewRow footerRow = GridView1.FooterRow;
Label lbl = new Label();
lbl.Text = "Create Footer Row";
footerRow.Cells[2].Controls.Add(lbl);
Tuesday, May 24, 2011
How to set identity seed in SQL SERVER by QUERY
If u want next number is 5000
then set seed as:
DBCC CHECKIDENT (tablename, reseed, 4999)
then set seed as:
DBCC CHECKIDENT (tablename, reseed, 4999)
Subscribe to:
Posts (Atom)