Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Sir,
below is my code for creating columns in datatable from textboxes.i want to show this textboxes data in same columns.i do that.but the problem is how to show the column names like
eg:
test this is data from first textbox
01 this is data from second textbox
if anyone knows the answer please help me....
C#
protected void btnSave_Click(object sender, EventArgs e)
      {
          dt.Columns.Add(txtnm.Text+"\n"+"grade"+txtgrade.Text);
          dt.Rows.Add("ROWS");
          gvAlumni.DataSource = dt;
          gvAlumni.DataBind();
          txtnm.Text = "";
          txtgrade.Text = "";

      }


[edit]SHOUTING removed - OriginalGriff [/edit]
Posted
Updated 11-Mar-14 22:22pm
v4
Comments
Dinesh.V.Kumar 12-Mar-14 3:08am    
Your question is not clear...
So you want the column name as "testgrade01" or "test" as one column and "grade01" as second column???

Regards
vineethnair 12-Mar-14 4:23am    
i need like this datatable column
test
grade01

in same column
Dinesh.V.Kumar 12-Mar-14 4:36am    
Why is that you need the column name like the one you have mentioned...Could you please let me know the purpose..??
OriginalGriff 12-Mar-14 3:27am    
DON'T SHOUT. Using all uppercase is considered shouting on the internet, and rude.
vineethnair 12-Mar-14 4:24am    
sorry sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900