在asp.net 2.0 里面怎么将DataSat绑定在TextBox上?要求只在代码(*.cs文件)中绑定,不要在网页(*.aspx文件)中绑定。别人介绍我使用DataBindings,但是我在asp.net 2.0 里都不成功,但是在WinFrom里面却可以,是不是asp.net 2.0 你支持手动绑定数据呢?

解决方案 »

  1.   

    直接赋值不可以吗?
    DataSet ds = new Dataset();Textbox.Text = ds.Tables[0].Rows[0]["字段名"] 不行吗
      

  2.   

    天呀,在ASP.NET中从来没见过DataSat这个控件.是DataSet
      

  3.   

    我知道我打错字了得没?是DataSet没错,我打错字啦。直接赋值实在太麻烦,因为所做的修改全部要更新回DataSet,用值绑定是最好的。
      

  4.   

    直接赋值实在太麻烦,因为所做的修改全部要更新回DataSet,用值绑定是最好的。
    ----------
    在TextBox上,
    Textbox.Text = ds.Tables[0].Rows[0]["字段名"]  这个是直接赋值也是用值绑定啊
      

  5.   


    neillove(南浦十三狼)那如果我是对TextBox中的文本进行了更改,更自动更新回DataSet里面吗?
      

  6.   

    for (int i = 0; i < count; i++)
                {
                    TextBox lb = GridView1.Rows[i].FindControl("TextBox1") as TextBox;
                    lb.ToolTip = lb.Text;
                   Textbox.Text = ds.Tables[0].Rows[i]["字段名"]             }
      

  7.   

    xiaojunyaoac() 请到http://community.csdn.net/Expert/TopicView.asp?id=5493178报道,再次领分~~