473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

best approach question: C# library in ASP Classic, what about data sets?

the enterprise is going to eventually convert the existing ASP Classic
website to ASP.NET

until that time, development has already begun for a C# library of
business objects. for the most part, the ASP Classic can make use of
the C# business objects without problem, because they were compiled and
registered through COM Interop.

however i have just reached a point of uncertainty: sets of data.
obviously C# has no problem using the ADO.NET objects to retrieve sets
of data, but so far the libraries can't seem to pass an SqlDataReader
object to ASP Classic, because those objects aren't COM friendly.

likewise, i haven't had much luck figuring out if/how C# can use ADO
Classic objects.

so that leaves me wondering how a C# class using COM Interop to be
instantiated in ASP Classic can pass an object with a set of data to
the ASP code.

thanks in advance for any help,

jason

Nov 17 '05 #1
2 1486
Jason,

I find this to be a pain point when trying to convert non-managed
data-manipulating apps to .NET. There isn't really a good story for
migration. Because you don't want to be stuck with the data model of ADO,
you don't want to use COM interop with the ADO COM libraries, but at the
same time, you want to protect the initial investment.

A proper design can help mitigate this somewhat, but it's still going to
be painful, because the core data container is changing. The best way I can
think of to get around this would be to develop your .NET code the way you
want it to be, without thought to the existing code. Then, I would write a
layer that would convert the data exposed by the .NET code in a manner that
can be consumed by your existing ASP application. The difficult part here
is that DataSets do not convert easily to Recordsets in ADO. It depends on
how complex your data is.

Using ADO in C# is easy. I believe the primary interop assemblies for
ADO are already included with the .NET framework. When you go to add a
reference, you should see it in the .NET section. If not, the list on the
COM tab will definitely contain the Microsoft ActiveX Data Objects.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jason" <ia****@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
the enterprise is going to eventually convert the existing ASP Classic
website to ASP.NET

until that time, development has already begun for a C# library of
business objects. for the most part, the ASP Classic can make use of
the C# business objects without problem, because they were compiled and
registered through COM Interop.

however i have just reached a point of uncertainty: sets of data.
obviously C# has no problem using the ADO.NET objects to retrieve sets
of data, but so far the libraries can't seem to pass an SqlDataReader
object to ASP Classic, because those objects aren't COM friendly.

likewise, i haven't had much luck figuring out if/how C# can use ADO
Classic objects.

so that leaves me wondering how a C# class using COM Interop to be
instantiated in ASP Classic can pass an object with a set of data to
the ASP code.

thanks in advance for any help,

jason

Nov 17 '05 #2
ok, i've gotten the ADO objects instantiating in my C# code, though now
i'm really boggled. i'm trying to build an ADO Recordset from a
standard ADO Command.Execute call, but the .NET implementation of the
Command.Execute requires three parameters that were optional in the old
ADO world. and they aren't the same types as the original either. they
want an out object for records affected, ref object for parameters, and
int for options.

i've been looking for clues on what to provide here, but so far i'm
getting a big WTF?

normally records affected wants an int. but an int for that parameter
generates a "cannot convert from int to out object". but if i give it
anything other than an int, i predict it will explode when it tries to
treat it like an int?

anyway, same story for the ref object for "Parameters". all my
parameters are being created/added before the Execute method is called.

any chance you can point me in the right direction for managing this
..NET version of the once-simple ADO Execute method?

thanks,

jason

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
0
by: D. Shane Fowlkes | last post by:
OK - I'm looking for the best approach on how to do this. I have a form page where the user can edit their "Profile" (data) which is in SQL Server. It's your basic company information - address,...
4
by: news.microsoft.com | last post by:
I am moving a classic ASP app to ASP.NET (c#). It is a series of pages that collect data, validtae the data and move to the next form. I used response.redirect in the classic ASP app but want to...
3
by: mokles | last post by:
Hi all, I am trying to start writing programs in VB.Net and ASP.Net for Windows and web applications. I have background in VB and classic ASP. The windows applicaiton will be database related (...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
13
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.