473,718 Members | 2,060 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 1888
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
2195
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
3528
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
1520
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
3712
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
4657
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
1878
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
2168
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
9358
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...
0
9208
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
9121
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,...
0
9053
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...
1
6654
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
4743
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3182
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
2559
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2123
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.