如何从paradox表中选择一个字段

编程入门 行业动态 更新时间:2024-10-25 22:34:12
本文介绍了如何从paradox表中选择一个字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试从一个paradox表中选择一个特定字段。在我创建的示例应用程序中,我只能检索并将表加载到数据集中,而不仅仅是特定字段 这是我的代码

private void qButton1_Click( object sender,EventArgs e) { OleDbConnection oledbParadoxconn = new OleDbConnection(); { string Sqltext = @ 从Clockd.EmpNo中选择*; string oledbconnstr = Provider = Microsoft.Jet.OLEDB.4.0;数据源= c:\\Program Files \\Supertime\\db;扩展属性= Paradox 5.x;; oledbParadoxconn.ConnectionString = oledbconnstr; oledbParadoxconn.Open(); OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(Sqltext,oledbParadoxconn); DataSet dtgetdata = new DataSet(); myDataAdapter.Fill(dtgetdata, table1); this .metroGrid1.DataSource = dtgetdata; this .metroGrid1.DataMember = 表1; }

有不同的选择方式来自悖论表的特定字段.Tlockd是表格,EmpNo是我想要使用的特定字段。 任何正确方向的帮助都将受到赞赏

解决方案

从我的评论中发布解决方案,因为OP说它有效。

字符串Sqltext = @从Clockd中选择EmpNo;

I am trying to select a specific field from a paradox table.In my sample app I created I can only retrieve and load the table into a dataset and not just a specific field This my code

private void qButton1_Click(object sender, EventArgs e) { OleDbConnection oledbParadoxconn = new OleDbConnection(); { string Sqltext = @"Select * from Clockd.EmpNo"; string oledbconnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Program Files\\Supertime\\db;Extended Properties=Paradox 5.x;"; oledbParadoxconn.ConnectionString = oledbconnstr; oledbParadoxconn.Open(); OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(Sqltext, oledbParadoxconn); DataSet dtgetdata = new DataSet(); myDataAdapter.Fill(dtgetdata, "table1"); this.metroGrid1.DataSource = dtgetdata; this.metroGrid1.DataMember = "table1"; }

Is there a different way to select a specific field from a paradox table.The Clockd is the table and the EmpNo is the specific field I want to use. Any help in the right direction would be appreciated

解决方案

Posting solution from my comment as OP has said it works.

string Sqltext = @"Select EmpNo from Clockd";

更多推荐

如何从paradox表中选择一个字段

本文发布于:2023-10-17 06:17:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1500015.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   paradox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!