Re: Executing a StoredProcedure using ADOCommand object in ASP.NET 2.0
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 6 Dec 2006 23:05:33 +0000 (UTC)
MJ (MJ@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I'm trying to convert an ASP application into ASP.NET 2.0 (changing
the extension for files .asp to .aspx and then fixing all the issues).
While fixing one of the page I found that the old page calls a stored
procedure and gets the data and this was done using ServerSide Java
Script.
Now since this page has been changed to ASPX page 2.0 with the page
directive as <%@ Page Language="VB" %> I cannot use Server Side JavaScript
and VB Script on one page. So I decided to move the code to a class file.
The code looks something like this..
public static ADODB.Recordset GetDataAsADORecordSet_SP(string
strSPName,
string strProductID, string strConn)
{
OleDbDataAdapter custDA = new OleDbDataAdapter();
ADODB.Connection adoConn = new ADODB.Connection();
I don't know why you get the error you get, but if you are moving to
..Net, why not make the full move and move to SqlClient? Or if you need
to support multiple engines, at least OleDb Client withóut the ADODB
stuff? Old ADO is a bunch of crap in my opinion, and ADO .Net is so
much cleaner and nicer to work with.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Prev by Date: Executing a StoredProcedure using ADOCommand object in ASP.NET 2.0
- Next by Date: Connect to XLS through ADO - Field names not coming through
- Previous by thread: Executing a StoredProcedure using ADOCommand object in ASP.NET 2.0
- Next by thread: Re: Executing a StoredProcedure using ADOCommand object in ASP.NET
- Index(es):
Relevant Pages
|