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

Identifing file type or OLE component migration to .net

We had an old application developed using Visual Basic Language.
We are trying to replace that application with .net 2005, C# Language.

In the old application, we had a file attachment component. Purpose of this
component was to attach a file to a ticket and store the file in the
database (Sybase).

I don't have access to the old application but have the following
information about
how this component worked:

1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved and
inserted into the OLE Container. Then activate() method was used to launch
the application associated to the attached file.
Problem we have is that when the file was saved to the database, Application
did not store the file name. So what we have is only the binary data in the
database.
We have no way of knowing what type of file it is (whether MSWord, MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.

As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.

What I like to know from you is

1. Is there any way or API, which can help me identify from the binary data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.
Jan 9 '06 #1
2 1863
talam,

Why don't you just import the OLE control into .NET? You can create an
ActiveX wrapper which will allow you to use it.

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

"talam" <ta***@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.com...
We had an old application developed using Visual Basic Language.
We are trying to replace that application with .net 2005, C# Language.

In the old application, we had a file attachment component. Purpose of
this
component was to attach a file to a ticket and store the file in the
database (Sybase).

I don't have access to the old application but have the following
information about
how this component worked:

1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved
and
inserted into the OLE Container. Then activate() method was used to
launch
the application associated to the attached file.
Problem we have is that when the file was saved to the database,
Application
did not store the file name. So what we have is only the binary data in
the
database.
We have no way of knowing what type of file it is (whether MSWord,
MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.

As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.

What I like to know from you is

1. Is there any way or API, which can help me identify from the binary
data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.

Jan 11 '06 #2
Thank you for your response. This Ole Control is one of the form control
provided as part of Vantive (Peoplesoft) CRM studio, used for form
customization etc.
I don't have access to their source code or the individual controls. We have
used the development studio to customized the forms using the control
provided. Any customized code are written in VBA.
I hope this explain the situation. Not sure whether we can use your
suggested approach.

"Nicholas Paldino [.NET/C# MVP]" wrote:
talam,

Why don't you just import the OLE control into .NET? You can create an
ActiveX wrapper which will allow you to use it.

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

"talam" <ta***@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.com...
We had an old application developed using Visual Basic Language.
We are trying to replace that application with .net 2005, C# Language.

In the old application, we had a file attachment component. Purpose of
this
component was to attach a file to a ticket and store the file in the
database (Sybase).

I don't have access to the old application but have the following
information about
how this component worked:

1. This component was using a OLE Container control.
2. When a file was selected for attachement, The file content was
inserted into the OLE control.
3. The Binary output of getdata()(????) function was inserted into the
database.
4. Later, when a file was selected to view, the binary data was retrieved
and
inserted into the OLE Container. Then activate() method was used to
launch
the application associated to the attached file.
Problem we have is that when the file was saved to the database,
Application
did not store the file name. So what we have is only the binary data in
the
database.
We have no way of knowing what type of file it is (whether MSWord,
MSExcel,
Zip file etc).
In the old application, it was the OLE control, which was identifying the
associated application
and opening the file using the application.

As in .net, we do not have any corresponding OLE Control, which can do the
similar functionality.

What I like to know from you is

1. Is there any way or API, which can help me identify from the binary
data,
what kind of
file it is (like word, excel, zip, text etc..)
2. Is there a way to achieve OLE Control like functionality in .net.


Jan 11 '06 #3

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

Similar topics

4
by: M P | last post by:
Can you help me find an asp code that will upload a file from my PC to web server? Mark
12
by: Matt | last post by:
I want to write a ASP page to open/download a file In fileview.jsp, I have the file browse, and when user click submit button, fileview2.asp should open the file. fileview.asp ============...
4
by: | last post by:
I have used my first aspx page on our site to utitlize the Ad Rotator component. However, I note that my traditional asp 3.0 code generations compilation errros (eg Let and Set not allowed in...
2
by: Eric Falsken | last post by:
Eric Falsken <eric@db4o.com> wrote on 04 Dec 2005: > craigkenisston@hotmail.com wrote on 19 Nov 2005: > >> I'm working in the migration of an asp.net application in 1.1 to 2.0. >> I'm new to...
8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
7
by: tshad | last post by:
I have a problem with a VS 2003 project. This project was designed and works fine in VS 2003. But trying to open the project I get the following error....
1
by: Jerry John | last post by:
I am working in ASP.NET with C#. I have a text file which contains datas with delimiters. For example:- MSH|^~\$|DISCHARGE|CLAY COUNTY MEMORIAL|||200502110939| I also have an XML file created...
0
by: lanesbalik | last post by:
hi all, right now i'm trying to migrate from db2 running under linux to mysql v5.1. i manage to export out the db2 structure & data into a del (ascii) file. but when i try to load the data...
3
by: Scav | last post by:
Helpful folks, We have recently migrated from V7 to V8 of UDB on Windows 2003. We are now in the process of setting up a rollout deployment to upgrade all of our user clent PC's from the V7...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.