同名model导致的Invalid operation for the current cursor position
来源:互联网 发布:ie内核浏览器for mac 编辑:程序博客网 时间:2024/04/25 22:03
使用分隔面板,在面板的上下区间内,各做一个表格显示数据库的数据,上区表格点击任意行时,下去表格根据选中的行找出与之对应的另一个表中的数据集.(在我的OA项目--客户管理中实现)
以下是抽取的两个表格显示的方法:
private void tup(String Tsql) {
String sql;
db = new dbsql();
db.connect();
if (Tsql.equals(" "))
sql = "select 客户编号=CID,客户名称=Cname,联系电话=Ctel,邮件=Cmail,公司地址=Cdz from client";
else
sql = "select 客户编号=CID,客户名称=Cname,联系电话=Ctel,邮件=Cmail,公司地址=Cdz from client";
rs = db.query(sql);
modelup = new ResultSetTableModel(rs);
panel_up = new JPanel();
panel_up.setLayout(new BorderLayout());
splitPaneVR.setLeftComponent(panel_up);
scrollPane_up = new JScrollPane();
panel_up.add(scrollPane_up, BorderLayout.CENTER);
table_up = new JTable(modelup);
table_up.addMouseListener(new MouseAdapter() {
public void mouseClicked(final MouseEvent arg0) {
int row = table_up.getSelectedRow(); // 获得当前选中的行号
ID = modelup.getValueAt(row, 0);
}
});
scrollPane_up.setViewportView(table_up);
}
private void tdown(String Dsql) {
String sql;
db = new dbsql();
db.connect();
if (Dsql.equals(" "))
sql = "select 联系人编号=TID,姓名=Tname,性别=Tsex,联系电话=Ttel,邮件=Tmail,所属部门=Tdept from contact";
else
sql = "select 联系人编号=TID,姓名=Tname,性别=Tsex,联系电话=Ttel,邮件=Tmail,所属部门=Tdept from contact";
rs = db.query(sql);
modeldown = new ResultSetTableModel(rs);
panel_down = new JPanel();
panel_down.setLayout(new BorderLayout());
splitPaneVR.setRightComponent(panel_down);
scrollPane_down = new JScrollPane();
panel_down.add(scrollPane_down, BorderLayout.CENTER);
table_down = new JTable(modeldown);
scrollPane_down.setViewportView(table_down);
}
以上红字部分修改前都是model,结果运行时出现异常,Invalid operation for the current cursor position--游标位于结果集首行之前,后来修正后正常.
- 同名model导致的Invalid operation for the current cursor position
- Setting the Cursor Position
- The entity type FooterLogo is not part of the model for the current context.zai
- The entity type <type> is not part of the model for the current context
- EntityFramework错误:The entity type XXX is not part of the model for the current context
- ORA-20001: Statistics Advisor: Invalid task name for the current user
- AE+C#开发问题之四——The Field type is invalid or unsupported for the operation. [Override]
- A conflict in the working copy obstructs the current operation
- IDA关于please position the cursor within a funtion的解决
- Magento Error:Invalid model for shipping method
- 一种Invalid Variant Operation错误的解决
- “Invalid pointer operation"异常的解决办法
- 出现Invalid operation. The connection is closed.这种错误
- The requested operation is invalid on a closed state
- Unable to update database to match the current model!
- DECLARE CURSOR FOR的使用
- DECLARE CURSOR FOR的使用
- 错误记录——Invalid field value for field "position".
- .Net3.5新的Socket异步模式总结
- drop all tables in database by T-SQL in SQLServer
- 随笔——感悟个人能力提高的三个阶段
- C# 加密
- 实现细线表格
- 同名model导致的Invalid operation for the current cursor position
- 一般的对表单数据验证的javascript代码收集
- 安装SQL Server2000 与 SP4补丁时挂起解决
- 重载++运算符
- 怎么管
- ASP.NET遇到问题---空引用异常
- UNIX 原始Socket 的缺陷
- Eclipe批量更新文件的编码类型
- 如何将程序注册系统服务