首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

数据库的format话语

2012-12-23 
数据库的format语句string strName1 updateError set AbsoE + A1.ToString() + where Error.EG

数据库的format语句
string strName1 = "update  Error set AbsoE =" + A1.ToString() + " where Error.EG=" + textBox5.Text + "";
  string strName2 = "select Format("({0})",strName1)";
       
   OleDbDataAdapter myadapter2 = new OleDbDataAdapter(strName2, aConnection);
         DataSet ds2= new DataSet();
        myadapter2.Fill(ds2);
想将数据库表里的数据格式化成带括号的形式,但是一直不对,求各位指点
[解决办法]
Format只支持数字类型和日期类型,而且没有加括号这种格式。
你可以select '('+ 列名 +')' from table这样来加括号

热点排行