应该这样做:SqlCommand  selectcommand1 = new SqlCommand ("select 表1.字段1,表2.字段2 from 表1,表2  where 表1.字段1=表2.字段1 ",MDImain.objconn );
objad.SelectCommand = selectcommand1;
objad.Fill (ds,"表1");DataGridTableStyle ts1 = new DataGridTableStyle ();
PropertyDescriptorCollection pcol = this.BindingContext[ds,"表1"].GetItemProperties() ;
ts1.MappingName = "表1";
DataGridColumnStyle Column1;
Column1 = new DataGridTextBoxColumn(pcol["字段2"]); 
Column1.MappingName = "字段2";
Column1.HeaderText = "字段1";
ts1.GridColumnStyles .Add (Column1);
dataGrid1.TableStyles .Add(ts1);
dataGrid1.SetDataBinding (ds,"Category");

解决方案 »

  1.   

    to  titicaca(枫叶) :
    你试一下就知道是否改变了显示内容!
      

  2.   

    你的表2应该有两个字段,分别是对应数字和大写数字!
    使用连接查询,然后在DataGrid中建立一个绑定列,绑定表2 的字段2就行了!!
      

  3.   

    Tracy_Z(一个人的精彩)  的方法是对的
    直接用SQL执行连接查询
      

  4.   

    使用template
    <asp:datagrid id=mydatagrid..................>
    <columns>
    <asp:ColumnTemplate ....(your attibute)>
        <%# DataBinder.Eval(....) %>
    </asp:ColumnTemplate>
    <columns>
    </asp:datagrid>
    大概是这样的,自己查msdn吧,好象QuickStart里面没有。
      

  5.   

    两个办法:
    办法一:在数据库端处理:
           读取数据时作条件判断:
           select iif(column1='1','壹',iif(column1='2','贰',column1)) as a from table1说明:这么写的话必须要用存储过程的      写入的时候再作处理,不再多说了:)方法二:在应用程序端处理:
           假设你已经把数据读取到table中,table 为一个datatable;
           if(table.Columns.indexof("a")==-1)
             table.columns.add("a",Type.GetType("System.String"),"iif(column1='1','壹',iif(column1='2','贰',column1)) ")
           绑定的时候,绑定a就可以了:)说明:因为习惯了自动完成,我对函数名称一向只记得前面几个字母:)不好意思,你拿回去必须自己试一下:)
      

  6.   

    用sql语句将两个表一关联就可以了。Select a.* ,b.字段2
    From 表1 a,表2 b  Where a.字段1*=b.字段1
      

  7.   

    to  ldsweely(刘笃师):
    你是怎么更新的?
    出什么错?