Hi
i have one doubt abt datagrid (using c#). pls help me
here is my code
//** code start here**
Page_Load event:
DataSet ds = BuildDataSet();
DataGrid1.DataS ource = ds;
DataGrid1.DataB ind();
private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
new DataColumn("ID" ,Type.GetType(" System.Int32")) ; dt.Columns.Add( dc); dc = new DataColumn("Nam e",Type.GetType ("System.String "));
dt.Columns.Add( dc); dc = new DataColumn("Dat e",Type.GetType ("System.DateTi me")); dt.Columns.Add( dc); // Fill the table with sample data
for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
dr["Date"] = DateTime.Now.Ad dSeconds(i * 10); dt.Rows.Add(dr) ; } // Return the dataset to the caller ret.Tables.Add( dt);
return ret;}
//**** code end here**
here i have add one more column with link . how can i add?
pls help me. pls send code immd
am waiting for ur reply
i want to be utput looks like this
ID Name Date URL
1 John Smith 1/1/2007 Hyper Link
2 John Smith 2/2/2007 Hyper Link
i have one doubt abt datagrid (using c#). pls help me
here is my code
//** code start here**
Page_Load event:
DataSet ds = BuildDataSet();
DataGrid1.DataS ource = ds;
DataGrid1.DataB ind();
private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
new DataColumn("ID" ,Type.GetType(" System.Int32")) ; dt.Columns.Add( dc); dc = new DataColumn("Nam e",Type.GetType ("System.String "));
dt.Columns.Add( dc); dc = new DataColumn("Dat e",Type.GetType ("System.DateTi me")); dt.Columns.Add( dc); // Fill the table with sample data
for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
dr["Date"] = DateTime.Now.Ad dSeconds(i * 10); dt.Rows.Add(dr) ; } // Return the dataset to the caller ret.Tables.Add( dt);
return ret;}
//**** code end here**
here i have add one more column with link . how can i add?
pls help me. pls send code immd
am waiting for ur reply
i want to be utput looks like this
ID Name Date URL
1 John Smith 1/1/2007 Hyper Link
2 John Smith 2/2/2007 Hyper Link
Comment