473,657 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing .NET components on a script page.

In ASP (pre .NET) I referenced components by

MyObj = Server.CreateOb ject("DllName.C lassname")

In .NET, I know that to reference the Sql namespace I use

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

What I am trying to do:

I have an ASP web application that uses VB 6 com components and I am trying
to convert it to .NET. The asp page instantiates a COM component that
returns a recordset (ADO) and displays it on the page. I am trying to do it
in .NET with .NET components in my application and display the data with a
SqlDataReader.

Thanks,

Jerry

--
Jerry
Nov 22 '05 #1
5 1212
Hi,

For accessing COM component use Type Library Importer create an
assembly as COM is an unmanaged code .Then add an reference in your project.
Below is the syntax
(eg) tlbimp SampleVBComp.dl l /out SampleCOM.dll

U can use <%@ Import Namespace="Samp leCOM" %> to access from ur page.
but recordset object is not compatible in .NET. To return data from db,use
some other approach in COM component.

"Jerry" wrote:
In ASP (pre .NET) I referenced components by

MyObj = Server.CreateOb ject("DllName.C lassname")

In .NET, I know that to reference the Sql namespace I use

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

What I am trying to do:

I have an ASP web application that uses VB 6 com components and I am trying
to convert it to .NET. The asp page instantiates a COM component that
returns a recordset (ADO) and displays it on the page. I am trying to do it
in .NET with .NET components in my application and display the data with a
SqlDataReader.

Thanks,

Jerry

--
Jerry

Nov 22 '05 #2
Santhi,

Thanks for the response, but I am not trying to use COM components. I am
trying to convert the COM components to .NET components and return a dataset
or a datareader from the .NET components and then use the data in the .aspx
page and not in the code behind page.

Thanks,
--
Jerry
"Santhi Maadhaven" wrote:
Hi,

For accessing COM component use Type Library Importer create an
assembly as COM is an unmanaged code .Then add an reference in your project.
Below is the syntax
(eg) tlbimp SampleVBComp.dl l /out SampleCOM.dll

U can use <%@ Import Namespace="Samp leCOM" %> to access from ur page.
but recordset object is not compatible in .NET. To return data from db,use
some other approach in COM component.

"Jerry" wrote:
In ASP (pre .NET) I referenced components by

MyObj = Server.CreateOb ject("DllName.C lassname")

In .NET, I know that to reference the Sql namespace I use

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

What I am trying to do:

I have an ASP web application that uses VB 6 com components and I am trying
to convert it to .NET. The asp page instantiates a COM component that
returns a recordset (ADO) and displays it on the page. I am trying to do it
in .NET with .NET components in my application and display the data with a
SqlDataReader.

Thanks,

Jerry

--
Jerry

Nov 22 '05 #3
Santhi,

Thanks for the response, but I am not trying to use COM components. I am
trying to convert the COM components to .NET components and return a dataset
or a datareader from the .NET components and then use the data in the .aspx
page and not in the code behind page.

Thanks,
--
Jerry
"Santhi Maadhaven" wrote:
Hi,

For accessing COM component use Type Library Importer create an
assembly as COM is an unmanaged code .Then add an reference in your project.
Below is the syntax
(eg) tlbimp SampleVBComp.dl l /out SampleCOM.dll

U can use <%@ Import Namespace="Samp leCOM" %> to access from ur page.
but recordset object is not compatible in .NET. To return data from db,use
some other approach in COM component.

"Jerry" wrote:
In ASP (pre .NET) I referenced components by

MyObj = Server.CreateOb ject("DllName.C lassname")

In .NET, I know that to reference the Sql namespace I use

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

What I am trying to do:

I have an ASP web application that uses VB 6 com components and I am trying
to convert it to .NET. The asp page instantiates a COM component that
returns a recordset (ADO) and displays it on the page. I am trying to do it
in .NET with .NET components in my application and display the data with a
SqlDataReader.

Thanks,

Jerry

--
Jerry

Nov 22 '05 #4
Jerry,

Fine..You can create .NET component by using Class Library and move
the logic of getting data from db from COM comp. to .NET Comp and return as
dataset.
Add the .NET Component reference to ur project and u can access the
component in .aspx page using server tags <% %>.Hope this helps you..

"Jerry" wrote:
Santhi,

Thanks for the response, but I am not trying to use COM components. I am
trying to convert the COM components to .NET components and return a dataset
or a datareader from the .NET components and then use the data in the .aspx
page and not in the code behind page.

Thanks,
--
Jerry
"Santhi Maadhaven" wrote:
Hi,

For accessing COM component use Type Library Importer create an
assembly as COM is an unmanaged code .Then add an reference in your project.
Below is the syntax
(eg) tlbimp SampleVBComp.dl l /out SampleCOM.dll

U can use <%@ Import Namespace="Samp leCOM" %> to access from ur page.
but recordset object is not compatible in .NET. To return data from db,use
some other approach in COM component.

"Jerry" wrote:
In ASP (pre .NET) I referenced components by

MyObj = Server.CreateOb ject("DllName.C lassname")

In .NET, I know that to reference the Sql namespace I use

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

What I am trying to do:

I have an ASP web application that uses VB 6 com components and I am trying
to convert it to .NET. The asp page instantiates a COM component that
returns a recordset (ADO) and displays it on the page. I am trying to do it
in .NET with .NET components in my application and display the data with a
SqlDataReader.

Thanks,

Jerry

--
Jerry

Nov 22 '05 #5
Santhi,

Thanks.

That does help and I finally got it working. To be more specific (for the
benefit of others) I added a project for the components and in the web
project I added a reference to the component.

In the .aspx page I added the following line:
<%@ Import Namespace="MyCl assLibrary"%>

which is preceded only by the following line:

<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb"
Inherits="WebAp plication3.WebF orm1"%>

The following also helped.

ms-help://MS.MSDNQTR.2003 FEB.1033/vbcon/html/vbconwalkthroug hcreatingwfccom ponent.htm
--
Jerry
"Santhi Maadhaven" wrote:
Jerry,

Fine..You can create .NET component by using Class Library and move
the logic of getting data from db from COM comp. to .NET Comp and return as
dataset.
Add the .NET Component reference to ur project and u can access the
component in .aspx page using server tags <% %>.Hope this helps you..

"Jerry" wrote:
Santhi,

Thanks for the response, but I am not trying to use COM components. I am
trying to convert the COM components to .NET components and return a dataset
or a datareader from the .NET components and then use the data in the .aspx
page and not in the code behind page.

Thanks,
--
Jerry
"Santhi Maadhaven" wrote:
Hi,

For accessing COM component use Type Library Importer create an
assembly as COM is an unmanaged code .Then add an reference in your project.
Below is the syntax
(eg) tlbimp SampleVBComp.dl l /out SampleCOM.dll

U can use <%@ Import Namespace="Samp leCOM" %> to access from ur page.
but recordset object is not compatible in .NET. To return data from db,use
some other approach in COM component.

"Jerry" wrote:

> In ASP (pre .NET) I referenced components by
>
> MyObj = Server.CreateOb ject("DllName.C lassname")
>
> In .NET, I know that to reference the Sql namespace I use
>
> <%@ Import Namespace="Syst em.Data.SqlClie nt" %>
>
> What I am trying to do:
>
> I have an ASP web application that uses VB 6 com components and I am trying
> to convert it to .NET. The asp page instantiates a COM component that
> returns a recordset (ADO) and displays it on the page. I am trying to do it
> in .NET with .NET components in my application and display the data with a
> SqlDataReader.
>
> Thanks,
>
> Jerry
>
>
>
>
>
> --
> Jerry

Nov 22 '05 #6

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

Similar topics

7
1641
by: CJM | last post by:
I realise this question has come up in some form or other many times in the past, but indulge me, please. I've just been reviewing a COM component (VB6) that I wrote a while ago to record when and where 404 errors occur; each error is logged in a DB along with supporting information. Looking at it now, I'm wondering why I chose a COM component rather than just an ASP page. There is not that much code involved, so I could easily have...
16
34551
by: Robert Mark Bram | last post by:
Hi All! Is there a way to reference a window by name without doing something like this: open (, 'windowName'); The open method will open a blank window if there is no window with such a name. I am trying to organise a navigation structure between two windows with content from the same host.. I have been trying the following:
3
1145
by: Lane | last post by:
Using this code to create a passable parameter <%@ Page Language="C#" ClassName="FirstPageClass" %><html><head><script runat="server" public string FirstName { get { return first.Text; }
4
1578
by: Martin Hill | last post by:
Hi there, How can I find the components added to web form from my custom web control? Suppose I added a Timer component (with name "timer1") onto the web form, from my user web control, how can I locate the timer component by name "timer1"? The Page.Controls collection only contains web controls but no components.
1
1028
by: John | last post by:
Hi all, I have a page which contains a few usercontrols inserted into placeholders on one main page. Inside one of these usercontrols is an iFrame tag which loads a page. If a user clicks on something within this page, I need to update a control in one of the other usercontrols elsewhere in the main page. How do I do this?
2
3097
by: Ric | last post by:
im new to asp.net. from what i understand, you have the aspx file (presentation), user-control(ascx file), code-behind(vb file) and components(compiled vb and dll files). the aspx file contains a reference to the ascx which can contain a reference to a component. can an aspx file contain a reference to an ascx file which contains a reference to a code-behind file? ive tried to do this then load the user-control via LoadControl(), but i...
4
3448
by: kstriyhon | last post by:
i need to manage mouse events in OWC pivot table in a web form not in a windows form and i can not find any information about this topic, the article i found manage events in a pivot table in a windows form but this does not work for what i need, i allready looked in the OWC black book but i can not find anythin about this particular issue. any help would be great, thank's in advance
0
1377
by: Frank | last post by:
I am attempting to convert an asp file to a asp.net file using C#. The original file has an ActiveX control which is contained in a cab file. The cab file contains the .ocx file which connects to a socket and transfers client info to a server, as well as several .dlls The cab file also references another cab file which contains files to install on the client machine in case they do not have VBRuntime6 installed on their machine.
3
1631
by: ASP Developer | last post by:
I would like to use a master page in my web application. All of my stylesheets and graphics are in folders one level above my web application. How do I go about referencing these files from pages that are one level below the master page. So for example on the master page I have: <script type="text/javascript" src="../globalstylesheets/javascriptfunctions.js"></script> Then I have a forms folder and inside there I have a page that...
0
8392
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
8305
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
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
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
5632
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
4151
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
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.