Forums » .NET » WPF »

connection string in wpf


Posted Date: 22 Aug 2008      Posted By:: ParasGautam     Member Level: Bronze    Member Rank: 0     Points: 1   Responses: 2



I am new to wpf,please explain how to make connection string in app.xaml file.



Responses

#285577    Author: Aravind PK      Member Level: Gold      Member Rank: 0     Date: 23/Aug/2008   Rating: 2 out of 52 out of 5     Points: 4

Use app.config to create connection string as how you may use in web.config file for connection settings in web based apps.

it can be like,
<appsettings>
<add key=".[your connection string key name you choose to have]." value="..[connection string value]..">
</appsettings>


 
#286626    Author: ParasGautam      Member Level: Bronze      Member Rank: 0     Date: 25/Aug/2008   Rating: 2 out of 52 out of 5     Points: 6

Hey Thanks for replying,but I tried the solution you gave,I put <appsetting> tag in app.xaml file like

<Application x:Class="WpfBinding.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>
<appsetting></appsetting>
</Application.Resources>

</Application>

But it gives the following error:-

Error1: The tag 'appsetting' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentat

Error2:The type 'appsetting' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

plese help


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : WPF Dataset xsd,xsc,xss??
Previous : Zooming of listboxitems
Return to Discussion Forum
Post New Message
Category: WPF

Related Messages

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John

Online Members

kush
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India