c#中对access数据表中增加表,增加字段、删除字段

作者: 浏览: 发布日期:2010-11-02
[导读]:

protected void btnjb_Click(object sender, EventArgs e)
    {
        string aa = txtname.Text.Trim();
        string str = "create table "+aa.ToString()+"(id autoincrement,uname text,email text,times datetime)";
        执行

    }

//ID是自动编码字段


    protected void btnadd_Click(object sender, EventArgs e)
    {
        string aa = txtlie1.Text.Trim();
        string str = "alter table baolei add column " + aa.ToString() + " int";
        执行

    }
    protected void btndel_Click(object sender, EventArgs e)
    {
        string aa = txtlie2.Text.Trim();
        string str = "alter table baolei drop column " + aa.ToString();
        执行

    }


免责声明:本文来源于网络,版权归原作者所有,仅供大家共同分享学习,如作者认为涉及侵权,请与我们联系,我们核实后立即删除。本站地址:http://www.sjz2.cn/news/show-143.html
请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!