App.config file Error Windows App

Posted by Self-innovator under VB.NET on 1/18/2012 | Points: 10 | Views : 1668 | Status : [Member] | Replies : 5
Dear all,
I've have a problem in my Windows app where i've have an app.config file in which i've given my Conn string...When i run the app it throws an error from app.config stating
ERROR:Failed to convert parameter value from a String to a Int16.
What might be this one Pls rectify...

Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: SheoNarayan on: 1/18/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Looks like there is some problem in your config file. Ensure that all opening tags have their corresponding closing tags.

If you can copy-paste your config file where it is throwing error that would help us pin point the problem. Enable debug = true in the config file and that will give you the exact location of the error.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-innovator on: 1/18/2012 [Member] Bronze | Points: 25

Up
0
Down
Thanks for ur co-op sir..
 <?xml version="1.0" encoding="utf-8" ?>

<configuration>
<appSettings>
<add key="SQLServerName" value="ProductionToCrm"/>
<add key="UserName" value="sa"/>
<add key="Password" value="sa12345"/>
<add key="DatabaseName" value="Coppertube"/>
<add key="SQLConnectionString" value="Data Source=ProductionToCrm;Initial Catalog=Coppertube;User ID=sa;Password=sa12345"/>
</appSettings>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
</configuration>


Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Blessyjees on: 1/18/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi,

I think that this error is not related to config file. Please specify the full error message including stack race.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanthlaxmi on: 1/18/2012 [Member] Starter | Points: 25

Up
0
Down
May i know how you are calling the Connection String Programmatically?

If this helps you .
Please "Mark as Answer"

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-innovator on: 1/19/2012 [Member] Bronze | Points: 25

Up
0
Down
Thanks for ur respnss..now its rectified..Actually i used one built in FrameWork in My app becoz of it it shows in app.config where i need to inherit the page design.

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response