473,802 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1501
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.co m

"jason" <ia****@yahoo.c om> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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
9278
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 C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
136
9461
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 code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
1
7942
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 version of the MS Graph type library. Up until now I have been walking them through the process of setting the references to include their version of MS Graph library. My problem is that I can not seem to get the syntax correct .. or perhaps...
0
1545
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, phone numbers, etc. I also have on the form a CheckListBox which is bound to another table in SQL Server - let's assume it the USA States so there's 50 checkboxes dynamically written to the page. When the user "adds" their data, they check all...
4
1729
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 know what options I have for an ASP.NET app. I could use pannels, but that would require a rather large set of viewstate data. I have about 15 forms, each with about 5-10 data elements. I could also use server.transfer I guess. My question is,...
3
971
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 ( displaying data from database, updating etc.), so Grid component will be big part of it. The windows application will be quite big. 1. What resources are out there for learning the .Net things? 2. Is there any commercial product or source code...
4
1844
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 logged in, on each and every page, and redirects the user to a login page if s/he's not logged in. The login page will also take care of some standard setup, such as choosing/populating a user profile. I used to use <!-- #include ... --for this,...
16
2823
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 efficient navigating within Visual Studio 2005. Let's say your project (or solution) has dozens of forms and hundreds or even thousands of routines. Two Questions: 1) BUILT-IN to Visual Studio 2005. What ideas do you have to quickly
13
2511
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 experience. We employ some parts of XP such as pair programming, and this should help. Other than books, does anyone have any suggestions? His skill set is pretty antiquated and we need to get him up to speed as quickly as possible so any suggestions...
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.