473,387 Members | 1,516 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,387 software developers and data experts.

Referencing .NET components on a script page.

In ASP (pre .NET) I referenced components by

MyObj = Server.CreateObject("DllName.Classname")

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

<%@ Import Namespace="System.Data.SqlClient" %>

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 1198
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.dll /out SampleCOM.dll

U can use <%@ Import Namespace="SampleCOM" %> 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.CreateObject("DllName.Classname")

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

<%@ Import Namespace="System.Data.SqlClient" %>

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.dll /out SampleCOM.dll

U can use <%@ Import Namespace="SampleCOM" %> 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.CreateObject("DllName.Classname")

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

<%@ Import Namespace="System.Data.SqlClient" %>

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.dll /out SampleCOM.dll

U can use <%@ Import Namespace="SampleCOM" %> 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.CreateObject("DllName.Classname")

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

<%@ Import Namespace="System.Data.SqlClient" %>

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.dll /out SampleCOM.dll

U can use <%@ Import Namespace="SampleCOM" %> 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.CreateObject("DllName.Classname")

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

<%@ Import Namespace="System.Data.SqlClient" %>

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="MyClassLibrary"%>

which is preceded only by the following line:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="WebApplication3.WebForm1"%>

The following also helped.

ms-help://MS.MSDNQTR.2003FEB.1033/vbcon/html/vbconwalkthroughcreatingwfccomponent.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.dll /out SampleCOM.dll

U can use <%@ Import Namespace="SampleCOM" %> 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.CreateObject("DllName.Classname")
>
> In .NET, I know that to reference the Sql namespace I use
>
> <%@ Import Namespace="System.Data.SqlClient" %>
>
> 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
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...
16
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....
3
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
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...
1
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...
2
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...
4
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...
0
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...
3
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...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.