Silverlight cannot connect to production SQLServer

  • Thanks to all in advance for reading this post.

    SW - SQLServer express 2005

    OS - Windows server 2003 (on Amazon cloud service EC2)

    I am trying to deploy a SilverLight 3 application and it cannot connect to the database on the target server. It runs fine on my local development station. I have ported over the database to the EC2 box, and can see the tables in SQLMS

    On the server, in a cmd shell, I have run the following commands

    (When I get the "1>" prompt, I assume I am connected)

    SQLCMD -E -S localhost -- this did not connect (at first)

    I have done this: Surface Area Configuration Tool -->

    Surface Area Configuration for services and connections -->

    Remote Connections --> Set to "Local and remote connections"

    Set to "Both TCP/IP and named pipes

    (I then restarted the SQLserver service)

    SQLCMD -E -S localhost -- this now connects

    I now try to connect using my named user and PW:

    sqlcmd -U MyUser -S localhost -P 89%#jhs123?}4 -- this connects.

    use MyTrack_live

    go

    Changed database context to ‘MyTrack_live’…..

    select labname from labs;

    go

    select username from Users;

    go

    The selects return expected, meaningful answers.

    This tells me that the DB is likely accepting outside connections.

    However, when I use the following in my Web.Config, I get an error message (see ErrorM1 below).

    <add name="MyTrack_liveConnectionString" connectionString="Data Source=IP-0AF666D4\SQLEXPRESS; Initial Catalog=MyTrack_live; User ID=MyUser;Password=89%#jhs123?}4; Integrated Security=True” providerName="System.Data.SqlClient" />

    A few questions:

    1) Is there some other client utility other than SQLCMD that will show more connectivity issues?

    2) I am in process of adding CLOG to the RIA so I can look at the logs. What else can I do to get this going?

    Thanks - Pop

    -- ErrorM1 --- start ---

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB0.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; FDM; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; BO1IE8_v1;ENUS)

    Timestamp: Thu, 21 Oct 2010 23:15:56 UTC

    Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

    at Shanghai.ServiceReference1.GetFullActiveLabsCompletedEventArgs.get_Result()

    at Shanghai.CorporateAdminPages.CorpAdminAdmin.webService_GetFullActiveLabsCompleted(Object sender, GetFullActiveLabsCompletedEventArgs e)

    at Shanghai.ServiceReference1.Service1Client.OnGetFullActiveLabsCompleted(Object state)

    Line: 1

    Char: 1

    Code: 0

    URI: http://184.73.193.135/Silverlight.js

    Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

    at Shanghai.ServiceReference1.GetGlobalDataCompletedEventArgs.get_Result()

    at Shanghai.CorporateAdminPages.CorpAdminAdmin.webservice_GetGlobalDataCompleted(Object sender, GetGlobalDataCompletedEventArgs e)

    at Shanghai.ServiceReference1.Service1Client.OnGetGlobalDataCompleted(Object state)

    Line: 1

    Char: 1

    Code: 0

    URI: http://184.73.193.135/Silverlight.js

    -- ErrorM1 --- end ---

  • here's my first guess, when covering the basics.

    your server has a hyphen in it's name. that causes problems, in my experience.

    i think the connection will have problems with that unless you wrap it in brackets, or switch to an ipaddress,port format:

    Data Source=IP-0AF666D4\SQLEXPRESS should be

    Data Source=[IP-0AF666D4]\SQLEXPRESS instead, i think.

    you could always rename the server too, but brackets fixes it quick.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Hi Lowell,

    Thanks for the cycles helping me with my issue.

    I tried the brackets to no avail. I also tried just a dot (".") as server name also to no avail.

    I am getting closer, as I know that none of these work:

    connectionString="Data Source=IP-0AF666D4\SQLEXPRESS;Initial Catalog=MyTrack_live; User ID=MyUser;Password=89%#jhs123?}4; Integrated Security=True"

    providerName="System.Data.SqlClient" />

    connectionString="Data Source=[IP-0AF666D4]\SQLEXPRESS;Initial Catalog=MyTrack_live; User ID=MyUser;Password=89%#jhs123?}4; Integrated Security=True"

    providerName="System.Data.SqlClient" />

    connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=MyTrack_live; User ID=MyUser;Password=89%#jhs123?}4; Integrated Security=True"

    providerName="System.Data.SqlClient" />

    Thanks - Pop

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply