如何在不同的列中将2个不同的数据源添加到单个gridview?

时间:2019-02-13 14:01:20

标签: c# asp.net

我有2个数据源想要放入2个不同的列中,如何将2个数据源添加到2个不同的列中?

        List<string> credits = new List<string>();
        List<string> status = new List<string>();

       /missing code shitty limits

            foreach(DataRow dataRow in dt.Rows) //Checks the server if it is running or not.
            {
                string value = dataRow.Field<string>("Slave_IO_Running"); //Looks for "Slave_IO_Running" status.

                if (value == "Yes")
                {                     
                    status.Add(Name + ": Working");
                    credits.Add(credentials);

                }
                else
                {
                    status.Add(Name  + ": Replication ERR");
                }
                break;
            }
            GridView1.DataSource = credits;
            GridView1.DataSource = status;
            GridView1.DataBind();

0 个答案:

没有答案