当前位置: 首页>>代码示例>>C#>>正文


C# DataTable.ToString方法代码示例

本文整理汇总了C#中DataTable.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DataTable.ToString方法的具体用法?C# DataTable.ToString怎么用?C# DataTable.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataTable的用法示例。


在下文中一共展示了DataTable.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e) //获取全部的Family
    {
        if (!this.IsPostBack)
        {
            DataTable fy = new DataTable();
            fy = uph.GetUPHFamily();
            var q = from r in fy.AsEnumerable()
                    select new ListItem(r[0].ToString());

            string FY = fy.ToString();
            this.Select3.Items.AddRange(q.ToArray());
            bindbullTable(null,20);
        }
    }
开发者ID:wra222,项目名称:testgit,代码行数:14,代码来源:UPH.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        bindbullTable(null, 20);
        if (!IsPostBack)
        {
            
                DataTable fy = new DataTable();
                fy = uph.GetLine1();
                var q = from r in fy.AsEnumerable()
                        select new ListItem(r[0].ToString());

                string FY = fy.ToString();
                this.DL_PdLine.Items.AddRange(q.ToArray());
                bindbullTable(null, 20);
        }
        DataTable sn = new DataTable();
        sn = uph.GetAlarmALL();
        bindbullTable(sn, 5);

    }
开发者ID:wra222,项目名称:testgit,代码行数:20,代码来源:AlarmMailAddress.aspx.cs

示例3: ToStringTest

        public void ToStringTest()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Col1", typeof(int));

            dt.TableName = "Mytable";
            dt.DisplayExpression = "Col1";

            string cmpr = dt.TableName + " + " + dt.DisplayExpression;
            Assert.Equal(cmpr, dt.ToString());
        }
开发者ID:dotnet,项目名称:corefx,代码行数:11,代码来源:DataTableTest.cs

示例4: insertNewUser

    public void insertNewUser(User userInput)
    {
        using (SqlConnection sqlCon = new SqlConnection(connectionstring))
        {
            String userName = userInput.UserName;
            string sql = "SELECT UserId FROM Users WHERE Email = '" + userName + "'";
            sqlCon.Open();
            SqlCommand command = new SqlCommand(sql, sqlCon);
            SqlDataAdapter da = new SqlDataAdapter(command);
            DataTable dt = new DataTable();
            da.Fill(dt);
            DataRow dr = dt.NewRow();
            response.message = dt.ToString();
            if (dt != null && dt.Rows.Count > 0) // Email id is  duplicate
            {
                response.status = "error";
                response.message = "Email id already exits";
            }
            else
            {
                int id = getLastInsertedUserId();
                String token = generateUniqueToken();
                if (token != "error")
                {
                    doInsert(userInput, (id + 1), token);
                }
                else
                {
                    response.status = "error";
                    response.message = "There was an error processing your request";

                }
                sqlCon.Close();
            }
        }
    }
开发者ID:nehaabrol87,项目名称:CS651-Final-Proj,代码行数:36,代码来源:Service.cs

示例5: generateUniqueToken

    public String generateUniqueToken()
    {
        using (SqlConnection sqlCon = new SqlConnection(connectionstring))
        {
            string sql = "SELECT NEWID()";
            sqlCon.Open();

            SqlCommand command = new SqlCommand(sql, sqlCon);
            SqlDataAdapter da = new SqlDataAdapter(command);
            DataTable dt = new DataTable();
            da.Fill(dt);
            DataRow dr = dt.NewRow();
            response.message = dt.ToString();
            if (dt != null && dt.Rows.Count > 0) // Email id is  duplicate
            {
                DataRow row = dt.Rows[0];
                return row[0].ToString();
            }
            else
            {
                return "error";
            }
        }
    }
开发者ID:nehaabrol87,项目名称:CS651-Final-Proj,代码行数:24,代码来源:Service.cs

示例6: verify

    public void verify(User userInput)
    {
        using (SqlConnection sqlCon = new SqlConnection(connectionstring))
        {
            String userId = userInput.UserId;
            String token = userInput.Token;
            string sql = "SELECT UserId FROM Users WHERE UserId = '" + userId + "' and token = '" + token + "' and verified = 'N'";

            sqlCon.Open();
            SqlCommand command = new SqlCommand(sql, sqlCon);
            SqlDataAdapter da = new SqlDataAdapter(command);
            DataTable dt = new DataTable();
            da.Fill(dt);
            DataRow dr = dt.NewRow();
            response.message = dt.ToString();
            if (dt != null && dt.Rows.Count > 0)
            {
                updateVerificationStatus(userId, token);
            }
            else
            {
                response.status = "error";
                response.message = "This user has already been verified or this is an incorrect link";
            }
            sqlCon.Close();
        }
    }
开发者ID:nehaabrol87,项目名称:CS651-Final-Proj,代码行数:27,代码来源:Service.cs


注:本文中的DataTable.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。