Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > VB.NET General Discussion

VB.NET General Discussion VB.NET general discussion area

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-30-2008, 2:24 PM
VB.NET Forum Newbie
.NET Framework: .NET 1.1 (VS 2003)
 
Join Date: Sep 2008
Posts: 2
Reputation: 0
Joe_VB is on a distinguished programming path ahead
Default Process.Start/Default file Editor

Hello all,

I am working on a VB.NET 2003 windows application in which I am using Diagnostics.Process.Start(...) to launch .sql editors. From afar, this seems like a fairly easy task, however, there are some small nuances that are making this a pain.

First off, users have a choice between multiple .sql editors (notepad, SQL 2000 Query Analyzer, SQL 2005 Management Studio and SQL 2008 Management Studio). Notepad and the SQL 2000 editor are both single instance applications, i.e. when multiple .sql files are opened, each file is opened in a new instance of the application. However, SQL 2005 and SQL 2008 take a tabbed approach, so you can have multiple .sql files opened within a single instance of the application.

Here is what I have:
If you do a Process.Start("<path of sql 2005 management studio", "c:\myfile.sql") it will open the .sql file in a new instance of management studio. If I were to run this multiple times, I would be opening multiple instances of management studio. However, each time I open a new .sql file, I'd like it to go into a new tab. I can achieve this by doing a Process.Start("c:\myfile.sql") and omitting the editor .exe. However, this will only work for the default .sql editor, which, in this case happens to be SQL 2005 Management Studio.

All that said, does anyone have any know of a way to possibly change the default editor for a file with a specific extension for the duration of my application run?

Example timeline:
Given: User X's default .sql editor is SQL 2005 Management Studio
1. User opens my application
2. User changes .sql editor (within my app) to SQL 2008 Management Studio (MS)
3. My app temporarily changes user X's default .sql editor to SQL 2008 MS. (This will enable Process.Start("myfile.sql") to open new tabs within same instance of 2008 MS.
4. User closes my application and their machine's original default .sql editor preference is restored.

Please let me know if any further clarification would be helpful.

Thanks in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-30-2008, 3:05 PM
JuggaloBrotha's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2004
Location: Lansing, MI; USA
Age: 25
Posts: 3,631
Reputation: 396
JuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NETJuggaloBrotha master of VB.NET
Default

Doesn't the 'SQL 2005 Management Studio' exe file take command line parameters? If it does you may be able to pass it the file and a param or two to tell it to open it in a tab of the previous instance.
__________________
Currently using: VS 2005 & 2008 Pro w/sp1 on Win7 Ultimate x64.


There are 3 kinds of people in the world: Those who can count and those who can't.
4 out of 3 people have trouble with fractions.

Windows has a 64 bit GUI for a set of 32 bit extensions on a 16 bit shell for an 8 bit OS using a 4 bit kernel made by a 2 bit company that can't stand 1 bit of competition.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-30-2008, 3:22 PM
VB.NET Forum Newbie
.NET Framework: .NET 1.1 (VS 2003)
 
Join Date: Sep 2008
Posts: 2
Reputation: 0
Joe_VB is on a distinguished programming path ahead
Default

Unfortunately, it doesn't appear that there is.

From BOL:

Ssms

[scriptfile] [projectfile] [solutionfile]
[-S servername] [-d databasename] [-U username] [-P password]
[-E] [-nosplash] [-?]

Any other thoughts?

Thanks again!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 8:11 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.