当前位置: 技术问答>java相关
jbuilder使用问题!
来源: 互联网 发布时间:2015-08-09
本文导语: 1、JBUILDER中,与数据库连接,显示表内容时,如何把表的字段名改为中文(sqlserver中)?? 2、在往表里新增一条记录时,提示如下错误: dataset has n unique row identifiers note: for querydatasets you need to disable metadatup...
1、JBUILDER中,与数据库连接,显示表内容时,如何把表的字段名改为中文(sqlserver中)??
2、在往表里新增一条记录时,提示如下错误:
dataset has n unique row identifiers
note: for querydatasets you need to disable metadatupdate.rowid in the metadataupdate property.in addition to setting the rowid property on a colunm.
谢谢!!!!
2、在往表里新增一条记录时,提示如下错误:
dataset has n unique row identifiers
note: for querydatasets you need to disable metadatupdate.rowid in the metadataupdate property.in addition to setting the rowid property on a colunm.
谢谢!!!!
|
问题1.在你所添加的queryDataSet中的每个column的caption属性栏中写入你想显示的字段名(中文)就行了
问题2.就像错误提示中说的那样,在你所添加的queryDataSet的metaDataUpdata属性栏中去掉Rowid选项,并且在每个column的rowid属性栏中选择True就OK了。
问题2.就像错误提示中说的那样,在你所添加的queryDataSet的metaDataUpdata属性栏中去掉Rowid选项,并且在每个column的rowid属性栏中选择True就OK了。
|
你可以这样插入:(大写的字符串是数据库表中的row项)
queryDataSet1.open();
DataRow dr = new DataRow(queryDataSet1, new String[] { "BUSIID","TRADNO","NAME","TIMEOUT","STARTCUST","CONDITION","REVFLAG"}); //初始化DATAROW
dr.setInt("BUSIID",busiid);
dr.setInt("TRADNO",tradno);
dr.setString("NAME",name);
dr.setInt("TIMEOUT",timeout);
dr.setInt("STARTCUST",startcust);
dr.setString("CONDITION",condition);
dr.setInt("REVFLAG",revflag);
queryDataSet1.updateRow(dr);
database1.saveChanges(queryDataSet1);
queryDataSet1.close();
queryDataSet1.open();
DataRow dr = new DataRow(queryDataSet1, new String[] { "BUSIID","TRADNO","NAME","TIMEOUT","STARTCUST","CONDITION","REVFLAG"}); //初始化DATAROW
dr.setInt("BUSIID",busiid);
dr.setInt("TRADNO",tradno);
dr.setString("NAME",name);
dr.setInt("TIMEOUT",timeout);
dr.setInt("STARTCUST",startcust);
dr.setString("CONDITION",condition);
dr.setInt("REVFLAG",revflag);
queryDataSet1.updateRow(dr);
database1.saveChanges(queryDataSet1);
queryDataSet1.close();