473,699 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

"talam" <ta***@discussi ons.microsoft.c om> wrote in message
news:94******** *************** ***********@mic rosoft.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.co m

"talam" <ta***@discussi ons.microsoft.c om> wrote in message
news:94******** *************** ***********@mic rosoft.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
2193
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
3521
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 ============ <FORM ACTION="fileview2.asp" method="POST"> <P><input type="FILE" name="filename"> <P><input type="submit">
4
1519
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 fuctions in new version) which puts to painful convervsion of code to aspx. But, is there a way to allow traditional asp to run on aspx page by codifying some form of 'transitional' declaration on the page in the same way one does for xhtml...
2
568
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 this application, just worked with that some days. >> Today, I decided to open the project in VS.2005 and everything seemed >> to be fine, all opened and everything was migrated. I have been >> working on improvements on it this day. >>
8
3707
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 and save it to a file. This step is not to hard however the contents of the textarea is mostly latex source so it contains just about every special character you can imagine. My question is this, how do I save an exact copy of the textarea...
7
4656
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. ************************************************************ The class EmailPoller can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try...
1
1874
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 with predefined tags. Some of the tags contain child element. I need to pass the data from the text file i.e the value within the delimiters should be passed to the corresponding tags within the XML file. I have done this through hard code. But i...
0
2164
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 from the del file to mysql table, it generate an error. below is the load data infile syntax i use =
3
1947
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 client to the V8 client using a response file. The process seems to go smoothly except for one major glitch. All of our users have the DB2 Security Service running on their machines set to start automatically. When the V8 migration takes place, it...
0
8687
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
9034
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...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6534
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
5874
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
4376
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...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
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.