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

Open file base on type

I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.

In asp.net, I use Response.OutputStream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!
Aug 3 '08 #1
2 1383
On Aug 3, 11:46 am, AY Xu <ay...@yahoo.comwrote:
I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.

In asp.net, I use Response.OutputStream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!
If i understood correclty,

System.Diagnostics.Process.Start
http://msdn.microsoft.com/en-us/libr...ess.start.aspx

Sure, if necessary applications have been associated with proper file
types like Ms Word for *.doc extensions already.

Hope this helps,

Onur Güzel
Aug 3 '08 #2
On 8ÔÂ3ÈÕ, ÏÂÎç5ʱ19·Ö, kimiraikkonen <kimiraikkone....@gmail.comwrote:
On Aug 3, 11:46 am, AY Xu <ay...@yahoo.comwrote:
I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.
In asp.net, I use Response.OutputStream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!

If i understood correclty,

System.Diagnostics.Process.Starthttp://msdn.microsoft.com/en-us/library/system.diagnostics.process.st...

Sure, if necessary applications have been associated with proper file
types like Ms Word for *.doc extensions already.

Hope this helps,

Onur G¨¹zel
Great, you point me to the right direction! i just set the file name,
then process.start(), .net automatically start right program to open
the file. that's great! thanks for help!
Aug 3 '08 #3

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

Similar topics

1
by: Konstantin | last post by:
Can someone help me figure out a way to open a form only once in an MDI app. I have an MDI app that contains several forms. I use each form depending on the type of document that the user needs...
29
by: Bill Marsden | last post by:
Hi. I am an under-graduate currently studying Open Source (Linux) vs Closed Source and Collaboration within the IT Community. I am fairly new to Javascript and I have written a "Lottery Program"...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
3
by: ccole | last post by:
I have about thirteen configuration files that are written in XML. I need to be able to read and cross reference these files with each other. I have already written an xsl translator but due to...
1
by: S | last post by:
Hi, I have the following xml file <?xml version="1.0" encoding="UTF-8" ?> <n1:Message xmlns:n1="nz:govt:moh:schemas:diabetes-cardio.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
4
by: Jon Davis | last post by:
Newbie to WCF here. I am getting the error "unable to open its IChannelListener", but the service is running as an admin, and on a different port from anything else. If it matters, I'm trying to...
0
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of...
4
by: JaxDawg | last post by:
I have a spreadsheet saved as an XML spreadsheet so I can manipulate it easier (and don't need COM). When I'm done, I want to display to the user. Currently, I'm using simple JavaScript in my PHP...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.