I have a DAL that I want to return an ADODB.recordset when executed from a classic asp. The object is exposed as a com object and I have a complete dal workin but I am not sure how to return an object that is a recordset that .net can use.
我有一个DAL,我想从经典的asp执行时返回ADODB.recordset。该对象作为一个com对象公开,我有一个完整的dal workin但我不知道如何返回一个.net可以使用的记录集对象。
Any help would be aprcitated. Thank you!
任何帮助都是无益的。谢谢!
--Nicolas
3 个解决方案
#1
1
You need to add a reference to the COM base ADODB in your Web Project along with a a reference to your DAL component. You should then be able to use the component much like you were in ASP.
您需要在Web项目中添加对COM基本ADODB的引用以及对DAL组件的引用。然后,您应该能够像使用ASP一样使用该组件。
That said you should read this KB:-
那说你应该读这个KB: -
I would strongly recommend you consider porting your DAL to a .NET assembly first.
我强烈建议您先考虑将DAL移植到.NET程序集中。
#2
1
I think you both for your feedback, but what I was looking to do was probably misunderstood, due to a poorly written question. I found a link to a page that did exactly what I was looking for.
我想你们两个都是为了你们的反馈,但由于写得不好,我想要做的事情可能会被误解。我找到了一个链接到一个完全符合我要求的页面。
What I have is a DAL that is an Assembly that I wanted to expose to ASP but to do so, to prevent from having to rewrite to much code I needed to first find a way to return a type of a recordset ONLY when called from Classic ASP apps. This would happen VIA a COM exposed method call that would make the call to the DAL and convert the returned .NET DataSet as a VB RecordSet.
我所拥有的是一个DAL,它是一个我想要暴露给ASP的程序集,但为了防止必须重写大量的代码,我需要首先找到一种方法来返回一个记录集的类型,当从Classic调用时ASP应用程序。这将通过COM公开的方法调用发生,该方法调用将调用DAL并将返回的.NET DataSet转换为VB RecordSet。
Here is the link that I found that made this possible. http://www.codeproject.com/KB/database/ADOConversion.aspx
这是我发现的链接,使这成为可能。 http://www.codeproject.com/KB/database/ADOConversion.aspx
Once Again, Thank you for your help and your input, and I apologize for such a poorly written question.
再一次,感谢您的帮助和您的意见,我为这样一个写得不好的问题道歉。
--Nicolas
#3
0
Ditto what Anthony said, if you can avoid this by all means do. If your DAL is a very generic DAL you can probally write one in .net or use someone elses like Application Block and spend less time then dealing with issues that might crop up.
同样安东尼所说的,如果可以通过各种方式避免这种做法。如果您的DAL是一个非常通用的DAL,您可以在.net中编写一个或者使用像Application Block这样的人,并花更少的时间来处理可能出现的问题。
#1
1
You need to add a reference to the COM base ADODB in your Web Project along with a a reference to your DAL component. You should then be able to use the component much like you were in ASP.
您需要在Web项目中添加对COM基本ADODB的引用以及对DAL组件的引用。然后,您应该能够像使用ASP一样使用该组件。
That said you should read this KB:-
那说你应该读这个KB: -
I would strongly recommend you consider porting your DAL to a .NET assembly first.
我强烈建议您先考虑将DAL移植到.NET程序集中。
#2
1
I think you both for your feedback, but what I was looking to do was probably misunderstood, due to a poorly written question. I found a link to a page that did exactly what I was looking for.
我想你们两个都是为了你们的反馈,但由于写得不好,我想要做的事情可能会被误解。我找到了一个链接到一个完全符合我要求的页面。
What I have is a DAL that is an Assembly that I wanted to expose to ASP but to do so, to prevent from having to rewrite to much code I needed to first find a way to return a type of a recordset ONLY when called from Classic ASP apps. This would happen VIA a COM exposed method call that would make the call to the DAL and convert the returned .NET DataSet as a VB RecordSet.
我所拥有的是一个DAL,它是一个我想要暴露给ASP的程序集,但为了防止必须重写大量的代码,我需要首先找到一种方法来返回一个记录集的类型,当从Classic调用时ASP应用程序。这将通过COM公开的方法调用发生,该方法调用将调用DAL并将返回的.NET DataSet转换为VB RecordSet。
Here is the link that I found that made this possible. http://www.codeproject.com/KB/database/ADOConversion.aspx
这是我发现的链接,使这成为可能。 http://www.codeproject.com/KB/database/ADOConversion.aspx
Once Again, Thank you for your help and your input, and I apologize for such a poorly written question.
再一次,感谢您的帮助和您的意见,我为这样一个写得不好的问题道歉。
--Nicolas
#3
0
Ditto what Anthony said, if you can avoid this by all means do. If your DAL is a very generic DAL you can probally write one in .net or use someone elses like Application Block and spend less time then dealing with issues that might crop up.
同样安东尼所说的,如果可以通过各种方式避免这种做法。如果您的DAL是一个非常通用的DAL,您可以在.net中编写一个或者使用像Application Block这样的人,并花更少的时间来处理可能出现的问题。