2012-03-14 2 views
0

接続文字列を取得します接続文字列を返すWebサービス。シルバー - Webサービスは</p> <p>顧客は今使用したい....私はデータベースのシリーズは、ボタンやリストボックス...通常のもののための情報をgathre呼び出し使用するSilverlightアプリケーションを持っている

接続文字列がweb.configファイルに読み込まれてもアプリケーションが正常に動作しますが、Webサービスから接続文字列を読み込もうとするとアプリケーションが実際に失敗する原因になります。

接続文字列を返すWebサービスは、接続文字列に基づいてコントロールを生成する他のスレッドより先に完了していないと仮定できます。

質問があります。Silverlightアプリケーションでは、コントロール文字列を入力する前に接続文字列Webサービス呼び出しを完了したいと思います。

ここで、websereviceコールが完了し、connectionstringの値が実際に値を持っていることを確認するにはどこですか?

おかげ トニー

答えて

0

私は、これは何が必要だと思う:

public App() 
{ 
    this.Startup += this.Application_Startup; 
    this.Exit += this.Application_Exit; 
    this.UnhandledException += this.Application_UnhandledException; 

    InitializeComponent(); 
} 

private void Application_Startup(object sender , StartupEventArgs e) 
{ 
    var client = new MyClient(); 
    client.GetConnectionStringCompleted += (clientSender, clientEventArgs) => 
    { 
    if (clientEventArgs.Error != null) 
    { 
     myConnectionString = clientEventArgs.Result; 
    } 
    this.RootVisual = new MainPage(); 
    }; 
    client.GetConnectionStringAsync(); 
} 
関連する問題

 関連する問題