Web.Config Issues?

Discussion in 'ASP .Net' started by Wayne Pedersen, Jan 26, 2007.

  1. Folks,

    I'm hosting through 1and1.com. I don't have a lot of experience
    deploying asp.net apps on shared webservers.

    I keep getting the following error message when trying to have my
    ASP.Net (2.0) web service access the SQL 2000 database:

    System.Web.Services.Protocols.SoapException was unhandled
    Actor=""
    Lang=""
    Message="System.Web.Services.Protocols.SoapException: Server was
    unable to process request. ---> System.InvalidCastException: Conversion
    from string "Data Source=mssql06.1and1.com;In" to type 'Integer' is not
    valid. ---> System.FormatException: Input string was not in a correct
    format.
    at
    Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
    Value, NumberFormatInfo NumberFormat)


    This does not make sense why is would be trying to convert my web.config
    connection string into an integer.

    Here's my web.config file:
    <?xml version="1.0"?>
    <!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>
    <connectionStrings>
    <add name="Web_LocatorConnectionString" connectionString="Data
    Source=mssql06.1and1.com;Initial Catalog=db181902399;User
    ID=dbo181902399;Password=xxxxx" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
    <!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.

    Visual Basic options:
    Set strict="true" to disallow all data type conversions
    where data loss can occur.
    Set explicit="true" to force declaration of all variables.
    -->
    <compilation debug="false" strict="false" explicit="true"/>
    <pages>
    <namespaces>
    <clear/>
    <add namespace="System"/>
    <add namespace="System.Collections"/>
    <add namespace="System.Collections.Specialized"/>
    <add namespace="System.Configuration"/>
    <add namespace="System.Text"/>
    <add namespace="System.Text.RegularExpressions"/>
    <add namespace="System.Web"/>
    <add namespace="System.Web.Caching"/>
    <add namespace="System.Web.SessionState"/>
    <add namespace="System.Web.Security"/>
    <add namespace="System.Web.Profile"/>
    <add namespace="System.Web.UI"/>
    <add namespace="System.Web.UI.WebControls"/>
    <add namespace="System.Web.UI.WebControls.WebParts"/>
    <add namespace="System.Web.UI.HtmlControls"/>
    </namespaces>
    </pages>

    <customErrors mode="Off"/>
    </system.web>
    </configuration>



    Thanks for any help and insight!
    Wayne Pedersen, Jan 26, 2007
    #1
    1. Advertising

  2. > unable to process request. ---> System.InvalidCastException: Conversion
    > from string "Data Source=mssql06.1and1.com;In" to type 'Integer' is not
    > valid. ---> System.FormatException: Input string was not in a correct
    > format.
    > at
    > Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
    > Value, NumberFormatInfo NumberFormat)


    Probably somewhere you code is doing that... accidently!

    Is there any thing more in the stack trace?

    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com
    www.edujini-labs.com
    http://eduzine.edujinionline.com
    -----------------------------------------
    Gaurav Vaish \(MasterGaurav\), Jan 26, 2007
    #2
    1. Advertising

  3. Here is the full stack trace:

    Again, this line is in my web.config file, not a line of code.

    System.Web.Services.Protocols.SoapException was unhandled
    Actor=""
    Lang=""
    Message="System.Web.Services.Protocols.SoapException: Server was
    unable to process request. ---> System.InvalidCastException: Conversion
    from string "Data Source=mssql06.1and1.com;In" to type 'Integer' is not
    valid. ---> System.FormatException: Input string was not in a correct
    format.
    at
    Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
    Value, NumberFormatInfo NumberFormat)
    at
    Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
    --- End of inner exception stack trace ---
    at
    Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
    at UploadData.UL_Equipment(Locator_DataSet RemoteDS)
    --- End of inner exception stack trace ---"
    Node=""
    Role=""
    Source="System.Web.Services"
    StackTrace:
    at
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
    message, WebResponse response, Stream responseStream, Boolean asyncCall)
    at
    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    methodName, Object[] parameters)
    at TestWS.localhost.UploadData.UL_Equipment(Locator_DataSet
    RemoteDS) in D:\Net Dev\AM_LocateMgr\TestWS\TestWS\Web
    References\localhost\Reference.vb:line 179
    at TestWS.Form1.btnSaveData_Click(Object sender, EventArgs e) in
    D:\Net Dev\AM_LocateMgr\TestWS\TestWS\Form1.vb:line 31
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m,
    MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at
    System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at
    System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
    hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at
    System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at
    System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
    dwComponentID, Int32 reason, Int32 pvLoopData)
    at
    System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
    reason, ApplicationContext context)
    at
    System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
    reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(ApplicationContext context)
    at
    Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    at
    Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    at
    Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
    commandLine)
    at TestWS.My.MyApplication.Main(String[] Args) in
    17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
    args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile,
    Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext
    executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()


    Gaurav Vaish (MasterGaurav) wrote:
    >> unable to process request. ---> System.InvalidCastException: Conversion
    >> from string "Data Source=mssql06.1and1.com;In" to type 'Integer' is not
    >> valid. ---> System.FormatException: Input string was not in a correct
    >> format.
    >> at
    >> Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
    >> Value, NumberFormatInfo NumberFormat)

    >
    > Probably somewhere you code is doing that... accidently!
    >
    > Is there any thing more in the stack trace?
    >
    Wayne Pedersen, Jan 26, 2007
    #3
  4. > at TestWS.localhost.UploadData.UL_Equipment(Locator_DataSet
    > RemoteDS) in D:\Net Dev\AM_LocateMgr\TestWS\TestWS\Web
    > References\localhost\Reference.vb:line 179


    Seems to me that you have a proxy-client for a web-service on "localhost".
    Now that it is trying to connect to the service on "localhost", it does not
    exist in a shared-web-hosting.

    You will need to update it appropriately.

    Also, it seems that the client expects an integer while the service has been
    modified (or, in my opinion, wrongly referenced) and returns a string.


    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com
    www.edujini-labs.com
    http://eduzine.edujinionline.com
    -----------------------------------------
    Gaurav Vaish \(MasterGaurav\), Jan 26, 2007
    #4
  5. I have modified the URL in code, the service was developed locally
    (hence the localhost reference). It is connecting to the proper public
    url, but with the error I indicated.

    The line referenced is the connection string line in the web.config
    file. It is a connection string, which should be a string. What would
    make ASP.Net try to turn it into an integer?

    Thanks!

    Wayne Pedersen

    Gaurav Vaish (MasterGaurav) wrote:
    >> at TestWS.localhost.UploadData.UL_Equipment(Locator_DataSet
    >> RemoteDS) in D:\Net Dev\AM_LocateMgr\TestWS\TestWS\Web
    >> References\localhost\Reference.vb:line 179

    >
    > Seems to me that you have a proxy-client for a web-service on "localhost".
    > Now that it is trying to connect to the service on "localhost", it does not
    > exist in a shared-web-hosting.
    >
    > You will need to update it appropriately.
    >
    > Also, it seems that the client expects an integer while the service has been
    > modified (or, in my opinion, wrongly referenced) and returns a string.
    >
    >
    Wayne Pedersen, Jan 26, 2007
    #5
  6. > The line referenced is the connection string line in the web.config file.
    > It is a connection string, which should be a string. What would make
    > ASP.Net try to turn it into an integer?


    That's what keeps me wondering still now.
    I think it's impossible to provide any support unless there's a peek on the
    code :(


    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com
    www.edujini-labs.com
    http://eduzine.edujini-labs.com
    -----------------------------------------
    Gaurav Vaish \(www.edujini-labs.com\), Jan 27, 2007
    #6
  7. Code:

    Desktop App (Consuming web service):

    Public Class Form1
    Dim svc As New localhost.UploadData
    Private Sub btnGetData_Click(ByVal sender As System.Object, ByVal e
    As System.EventArgs) Handles btnGetData.Click
    Dim ds As New localhost.Locator_DataSet
    ds = svc.GetEquip
    Grid.DataSource = ds
    Grid.DataMember = "Equipment"
    End Sub

    Private Sub btnSaveData_Click(ByVal sender As System.Object, ByVal
    e As System.EventArgs) Handles btnSaveData.Click
    Dim ds As New localhost.Locator_DataSet
    For x As Integer = 80 To 100
    Dim newRow As DataRow = ds.Equipment.NewRow

    newRow.Item("EquipmentID") = x
    newRow.Item("Name") = "Test Record " & x

    ds.Equipment.Rows.Add(newRow)
    Next

    svc.UL_Equipment(ds)

    ds.Clear()
    ds = svc.GetEquip
    Grid.DataSource = ds
    Grid.DataMember = "Equipment"
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    svc.Url = "http://www.ariesearch.com/datamerge/UploadData.asmx"
    End Sub
    End Class




    WebService (Serving the GetEquip Routine):

    <WebMethod()> _
    Public Function GetEquip() As DataMerge.Data.Locator_DataSet

    ta_Equip.Fill(ds_Loc.Equipment)
    Return ds_Loc



    End Function









    Gaurav Vaish (www.edujini-labs.com) wrote:
    >> The line referenced is the connection string line in the web.config file.
    >> It is a connection string, which should be a string. What would make
    >> ASP.Net try to turn it into an integer?

    >
    > That's what keeps me wondering still now.
    > I think it's impossible to provide any support unless there's a peek on the
    > code :(
    >
    >
    Wayne Pedersen, Jan 30, 2007
    #7
  8. MasterGaurav \(www.edujini-labs.com\), Feb 7, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pavan Apuroop
    Replies:
    3
    Views:
    2,294
    =?Utf-8?B?c3Jpbmk=?=
    Jun 21, 2005
  2. Benny Ng
    Replies:
    9
    Views:
    9,962
    Benny Ng
    Oct 13, 2005
  3. Replies:
    4
    Views:
    10,288
    Kevin Spencer
    Apr 5, 2006
  4. Replies:
    0
    Views:
    1,598
  5. CSharpner
    Replies:
    0
    Views:
    1,023
    CSharpner
    Apr 9, 2007
Loading...

Share This Page