在C#中将数据集转换为Recordset [英] Convert Dataset to Recordset in C#

查看:145
本文介绍了在C#中将数据集转换为Recordset的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据集转换为ADODB.Recordset。我创建了sxl

文件并使用以下命令在VB.NET中打开它:

Dim rs as ADODB.Recordset

rs.Open(" ; C:\ files \ xslfile.xsl")

我想在C#中做同样的事情。除了xsl文件之外,C#中的open方法还需要几个额外的参数:

rs.Open(" C:\ files \ xslfile.xsl",对象ActiveConnection,

ADODB.CursorTypeEnum,ADODB.LockTypeEnum,int选项)


虽然对每个人来说看起来很明显,但我无法提供

使这个方法有效的有效参数。


非常感谢任何帮助。


Robert

-

Robert Hill

高级程序员/分析师

Wake Forest Univ Baptist Med Ctr

I am trying to convert a dataset to an ADODB.Recordset. I create the sxl
file and open it in VB.NET by using:
Dim rs as ADODB.Recordset
rs.Open("C:\files\xslfile.xsl")

I want to do this same thing in C#. The open method in C# takes several
additional parameters in addition to the xsl file:
rs.Open("C:\files\xslfile.xsl", object ActiveConnection,
ADODB.CursorTypeEnum, ADODB.LockTypeEnum, int Options)

While it may seem very obvious to everyone, I am having trouble providing
valid arguments to make this method work.

Any help is greatly appreciated.

Robert
--
Robert Hill
Senior Programmer/Analyst
Wake Forest Univ Baptist Med Ctr

推荐答案

2004年12月30日,Marathoner写道:
On 30/12/2004 Marathoner wrote:
我正在尝试将数据集转换为ADODB.Recordset。我创建了
sxl文件,并在VB.NET中使用以下命令打开它:
Dim rs as ADODB.Recordset
rs.Open(" C:\ files \ xslfile.xsl" )

我想在C#中做同样的事情。除了xsl文件之外,C#中的open方法还需要几个附加参数:
rs.Open(" C:\ files \ xslfile.xsl",object ActiveConnection,
ADODB .CursorTypeEnum,ADODB.LockTypeEnum,int选项)

虽然对每个人来说看起来都很明显,但我很难提供有效的参数来使这个方法有效。

罗伯特
I am trying to convert a dataset to an ADODB.Recordset. I create the
sxl file and open it in VB.NET by using:
Dim rs as ADODB.Recordset
rs.Open("C:\files\xslfile.xsl")

I want to do this same thing in C#. The open method in C# takes
several additional parameters in addition to the xsl file:
rs.Open("C:\files\xslfile.xsl", object ActiveConnection,
ADODB.CursorTypeEnum, ADODB.LockTypeEnum, int Options)

While it may seem very obvious to everyone, I am having trouble
providing valid arguments to make this method work.

Any help is greatly appreciated.

Robert




嗨罗伯特。


这是我如何使用Access数据库:


string strConnection;

string strQuery;


strConnection =" Provider = Microsoft.Jet.OLEDB.4.0;" ;;

strConnection + ="数据源=" ;;

strConnection + = this.m_strDBName;

strConnection + =" ;;" ;;


strQuery =" SELECT * FROM" + this.m_strTableName +"在哪里blnCompany

= True" ;;


adCON.Open(strConnection,"","",0);

adRS.Open(strQuery,adCON,ADODB.CursorTypeEnum.adOpenKeyset,

ADODB.LockTypeEnum.adLockOptimistic,0);


你能选择那个骨头?


-

Jeff Gaines

发布于XanaNews 1.17.1.2 http://www.wilsonc.demon.co.uk/delphi.htm


感谢您的回复。


我从xsl文件而不是数据库打开记录集。你怎么用C#做



Robert


" Jeff Gaines"写道:
Thanks for the reply.

I am opening a recordset from a xsl file, not a database. How would you do
that in C#?

Robert

"Jeff Gaines" wrote:
2004年12月30日,Marathoner写道:
On 30/12/2004 Marathoner wrote:
我正在尝试将数据集转换为ADODB.Recordset。我创建了
sxl文件,并在VB.NET中使用以下命令打开它:
Dim rs as ADODB.Recordset
rs.Open(" C:\ files \ xslfile.xsl" )

我想在C#中做同样的事情。除了xsl文件之外,C#中的open方法还需要几个附加参数:
rs.Open(" C:\ files \ xslfile.xsl",object ActiveConnection,
ADODB .CursorTypeEnum,ADODB.LockTypeEnum,int选项)

虽然对每个人来说看起来都很明显,但我很难提供有效的参数来使这个方法有效。

罗伯特
I am trying to convert a dataset to an ADODB.Recordset. I create the
sxl file and open it in VB.NET by using:
Dim rs as ADODB.Recordset
rs.Open("C:\files\xslfile.xsl")

I want to do this same thing in C#. The open method in C# takes
several additional parameters in addition to the xsl file:
rs.Open("C:\files\xslfile.xsl", object ActiveConnection,
ADODB.CursorTypeEnum, ADODB.LockTypeEnum, int Options)

While it may seem very obvious to everyone, I am having trouble
providing valid arguments to make this method work.

Any help is greatly appreciated.

Robert



罗伯特。

这就是我使用Access数据库的方式:

字符串strConnection;
字符串strQuery;

strConnection =" Provider = Microsoft.Jet.OLEDB.4.0;" ;;
strConnection + =" ;数据源=" ;;
strConnection + = this.m_strDBName;
strConnection + =" ;;" ;;

strQuery =" SELECT * FROM" + this.m_strTableName +" WHERE blnCompany
= True" ;;

adCON.Open(strConnection,","",0);
adRS.Open(strQuery,adCON,ADODB) .CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic,0);

你能从中挑选骨头吗?

-
Jeff Gaines
发布于XanaNews 1.17.1.2 http:// www。 wilsonc.demon.co.uk/delphi.htm



Marathoner写道:
Marathoner wrote:
感谢您的回复。

我是从xsl文件打开记录集,而不是数据库。你会怎么做呢?在C#中?
Thanks for the reply.

I am opening a recordset from a xsl file, not a database. How would you do
that in C#?



< snip>


为什么不使用OleDb .net类?


您可以使用与ADODB.Connection相同的提供商。


-

Lasse V? ¥gs?| karl Karlsen
http://www.vkarlsen.no/

mailto:la *** @ vkarlsen.no

PGP KeyID:0x0270466B


<snip>

Why not use the OleDb .net classes ?

You can use the same provider as you would for ADODB.Connection.

--
Lasse V?¥gs?|ther Karlsen
http://www.vkarlsen.no/
mailto:la***@vkarlsen.no
PGP KeyID: 0x0270466B


这篇关于在C#中将数据集转换为Recordset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆