Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2008, 03:13 PM
mlw mlw is offline
Registered User
 
Join Date: Jun 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connections in a Sql Server project

I created a Sql Server project so I could play with writing CLR functions. During the project set-up I was required to choose a data source that is then stored in the project. All fine and good. Functions written, deployed, and working.

Now I want to change the "hard-wired" connection so I can deploy my functions to another database on the same server. I have gone to the properties tab on the project and it won't let me change the connection string. The problem is when I select the server instance and the new database target it cannot connect. Odd thing is I can see the new database I want in the server explorer in the IDE. I tried changing it in the xxx.csproj.user file of the project ( the XML ) and it basically ignored it and kept using the old connection string. I have looked in every file in the project and cannot find any other place I reference the connect string. Where else might it be stored?

Both the old and new database exist on the server and I have full permissions. The server instance ( local on my machine ) also allows remote connections and has the CLR option turned on.

Any ideas and while I am at it how do I allow the connection string to be changed at runtime and still be allowed to use the context connection attribute?

Thanks,

MW

 
Old September 13th, 2008, 03:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Does the Deploy Solution option on the Build menu help?

http://msdn.microsoft.com/en-us/library/dahcx0ww(VS.80).aspx

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old September 15th, 2008, 09:32 AM
mlw mlw is offline
Registered User
 
Join Date: Jun 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was using that and there appear to be no options.

I figure what I will have to do is create my sprocs/UDF's as a C# class library and always go and get the connection string when I need it rather than use the context connection attribute in a Sql Server project. Then I can compile the code and deploy it manually by using the CREATE ASSEMBLY command on the server.

Bummer.






Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
Access-SQL Server Connections Romashka Access 3 May 25th, 2007 06:26 AM
migrating from sql server 2000 to sql server 2005 abinashpatra SQL Server 2005 2 December 1st, 2006 03:45 PM
Wacky ASP Connections to SQL Server-PROBLEM SOLVED buddyz Classic ASP Databases 13 August 24th, 2006 08:29 AM
Access 2003 project and SQL server 2005 jesseleon Access VBA 3 February 23rd, 2006 12:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.