且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将主键添加到数据集/数据表

更新时间:2023-11-30 22:54:16

OleDataAdapter在其select命令/语句中应该有主键,

例如从员工中选择Employee_ID


然后使用fill命令填充数据集


OleDataAdapter.Fill(数据集)

就是这样,你将在ur数据集中拥有主键

Bernie Yaeger <是***** @ cherwellinc.com>在消息中写道

新闻:eH ************** @ TK2MSFTNGP10.phx.gbl ...
OleDataAdapter should have primary key in its select command/statement,
for e.g Select Employee_ID from employees

Then use fill command to fill the dataset

OleDataAdapter.Fill(Dataset)
thats it, you''ll have primary key in ur dataset
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
我有需要将主键添加到数据集/数据表。如何使用标准oledb数据提供程序完成这项工作?

Tx提供任何帮助。
I have a need to add a primary key to a dataset/datatable. How can this be
done using a standard oledb data provider?

Tx for any help.



Hi Arsalan 。


我正在使用vfp免费表 -

原始表中没有主键,它们不能添加到后端(因为他们不是我的b
$并且添加一列会搞砸他们。)


伯尼


"阿尔萨兰&QUOT; &LT; AR *********** @ hotmail.com&GT;在消息中写道

新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Hi Arsalan.

I am working with vfp free tables - there are no primary keys in the
original tables and they can''t be added to the backend (because they are not
mine and adding a column would screw them up).

Bernie

"Arsalan" <ar***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
OleDataAdapter应该在其select命令/语句中有主键,
例如从员工中选择Employee_ID

然后使用fill命令填充数据集

OleDataAdapter.Fill(Dataset)
多数民众赞成在你的数据集中你将拥有主键

" Bernie Yaeger" &LT;是***** @ cherwellinc.com&GT;在消息中写道
新闻:eH ************** @ TK2MSFTNGP10.phx.gbl ...
OleDataAdapter should have primary key in its select command/statement,
for e.g Select Employee_ID from employees

Then use fill command to fill the dataset

OleDataAdapter.Fill(Dataset)
thats it, you''ll have primary key in ur dataset
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
我需要添加一个主键到数据集/数据表。如何使用标准的oledb数据提供程序完成这项工作?

Tx可以提供任何帮助。
I have a need to add a primary key to a dataset/datatable. How can this
be done using a standard oledb data provider?

Tx for any help.




如果表结构不包含主键,则不可能将
添加到数据集中。

如何从列表别名创建列别名两个或多个列[如复合

主键]可以从表格中选择记录,

这一切都取决于你在哪个列中数据库表


" Bernie Yaeger" &LT;是***** @ cherwellinc.com&GT;在消息中写道

新闻:uv ************* @ TK2MSFTNGP15.phx.gbl ...
If the table structure doesn''t contain primary key then its impossible to
add it to the dataset.
How about making a column alias from two or more columns [like composite
primary key] that would make it possible to select records from the table,
it all depends on what kind of column u have in ur database table

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:uv*************@TK2MSFTNGP15.phx.gbl...
嗨Arsalan。

我正在使用vfp免费表 -
原始表中没有主键,它们不能添加到后端(因为它们不是我的并且添加了一个专栏将他们搞砸了。

Bernie

Arsalan &LT; AR *********** @ hotmail.com&GT;在消息中写道
新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Hi Arsalan.

I am working with vfp free tables - there are no primary keys in the
original tables and they can''t be added to the backend (because they are
not mine and adding a column would screw them up).

Bernie

"Arsalan" <ar***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
OleDataAdapter应该有主键其选择命令/声明,例如,从员工中选择Employee_ID

然后使用fill命令填充数据集

OleDataAdapter.Fill(Dataset)
多数民众赞成在你的数据集中你将拥有主键

" Bernie Yaeger" &LT;是***** @ cherwellinc.com&GT;在消息中写道
新闻:eH ************** @ TK2MSFTNGP10.phx.gbl ...
OleDataAdapter should have primary key in its select command/statement,
for e.g Select Employee_ID from employees

Then use fill command to fill the dataset

OleDataAdapter.Fill(Dataset)
thats it, you''ll have primary key in ur dataset
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
我需要添加一个主键到数据集/数据表。如何使用标准的oledb数据提供程序完成这项工作?

Tx可以提供任何帮助。
I have a need to add a primary key to a dataset/datatable. How can this
be done using a standard oledb data provider?

Tx for any help.