VB.Net - Create SQL Server Alias
Posted on 2003-11-04
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.