Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VB.Net - Create SQL Server Alias

Posted on 2003-11-04
3
2,682 Views
Last Modified: 2009-08-28
I'm working on a distributed VB.Net application and I need to know how to create a SQL Server (actually MSDE) alias on the client's computer via code.

Basic process in place right now:

1) Along with application install, I also install a new MSDE instance on client computer.

2) The first time my app runs I create a new database within the instance by sending the "create database..." command through a SqlClient.SqlCommand.

3) Immediately after creating the database I use a SQLMERGXLib.SQLMerge object to create an anonymous internet pull subscription to the parent SQL Server database.

Without an alias, my replication doesn't work because of a combination of Novel communication protocols and our firewall.  I've resolved the issue so that it will work *IF* the Client Network Utility is used to create an alias with the internal network machine name for the parent database.

My problem is that many of the client computers won't have access to the Client Network Utility that comes with the full version of SQL Server and even if they do, I can't trust the end user to correctly configure it.

I'm open to a solution that works with vb.net code directly or by calling a stored procedure in sql-server.
0
Comment
Question by:frodoman
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
NetPointer earned 500 total points
ID: 9683365
This Might help u...

http://support.microsoft.com/?kbid=815431

other thing is, i think this information is stored in registry by sql server...if that is the case, then u can use regmonitor tool and create one for testing, thus monitoring which values it is creating...then u can generate those reg keys while installation...

I have never done this, but just as a hint...i also dont know it is behaving that way or not.

Regards,
NetPointer
0
 
LVL 42

Author Comment

by:frodoman
ID: 9686329
NetPointer,

Thanks for the attempt, but I've already read this one.  It did help me in resolving my initial problem, but I can't count on my end-users to install properly configure the Client Network Utility so this solution won't work...

I'll check into the registry suggestion.

Thanks,

Frodoman
0
 
LVL 42

Author Comment

by:frodoman
ID: 9686704
NetPointer,

Registry was a success - thanks much!

For anyone reading this in the future, here's the registry key to set:

   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo

And a list of the protocols and settings can be found here:

   http://support.microsoft.com/default.aspx?scid=kb;en-us;250550
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question