如何在DataTable中溢出列名 [英] How to spilt the column names in DataTable

查看:82
本文介绍了如何在DataTable中溢出列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

下面是我在textboxes.i中创建数据表中的列的代码。想要在同一列中显示这个文本框数据。我这样做。但问题是如何显示列名喜欢

例如:

测试这是来自第一个文本框的数据

01这是来自第二个文本框的数据

if任何人都知道答案,请帮助我....

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....

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 = "";

      }





SHOUTING删除 - OriginalGriff [/ edit]



[edit]SHOUTING removed - OriginalGriff [/edit]

推荐答案

这篇关于如何在DataTable中溢出列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆