Thursday, August 29, 2013

[sharepoint] Re: visual web parts - posibilities in order to get the connection string

 



--- In sharepoint@yahoogroups.com, "Russel" <rcroweg@...> wrote:
>
> Hi all
> I'm new into this group.
>
> I'm an initial developer in sharepoint 2010 technologies, with C# and Visual studio.
>
> I've recently developed a visual web part with visual studio, and using an entiy framework model into a class library (as layer Dal).
> I need the best alternatives in orther to get the connection string (to connect to a SQL database), having in consideration that the aplication must be deployed, after develop, in diferents testing and production environments (diferents servers), and we need change te connection strings properties between them.
>
> Thanks in advance.
>

Russell,
The best way to store connection string is to keep it in a PropertyBag property at some appropriate level of the SharePoint website hierarchy, for example a WebApp or Site or Web Property bag. For a very robust example of this, see the Applications Settings Manager at http://msdn.microsoft.com/en-us/library/ff798488.aspx. Also see spg.codeplex.com, which should have the corresponding code.
Michael

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___

No comments: