Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 421473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:59:12+00:00 2026-05-12T18:59:12+00:00

public string[] SearchForMovie(string SearchParameter) { WebClientX.DownloadDataCompleted += new DownloadDataCompletedEventHandler(WebClientX_DownloadDataCompleted); WebClientX.DownloadDataAsync(new Uri( http://www.imdb.com/find?s=all&q=ironman+&x=0&y=0 )); string

  • 0

public string[] SearchForMovie(string SearchParameter)
{
WebClientX.DownloadDataCompleted += new
DownloadDataCompletedEventHandler(WebClientX_DownloadDataCompleted);
WebClientX.DownloadDataAsync(new Uri(
“http://www.imdb.com/find?s=all&q=ironman+&x=0&y=0“));

    string sitesearchSource = Encoding.ASCII.GetString(Buffer);
}

void WebClientX_DownloadDataCompleted(object sender,
    DownloadDataCompletedEventArgs e)
{
    Buffer = e.Result;
    throw new NotImplementedException();
}

I get this exception:

The matrix cannot be null. Refering to my byte[] variable Buffer.

So, I can conclude that the DownloadDataAsync isn’t really downloading anything. What is causing this problem?

PS. How can I easily format my code so it appear properly indented here. Why can’t I just copy past the code from Visual C# express and maintain the indentation here? Thanks! 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:59:12+00:00Added an answer on May 12, 2026 at 6:59 pm

    The key word here is “async”; when you call DownloadDataAsync, it only starts the download; it isn’t complete yet. You need to process the data in the callback (WebClientX_DownloadDataCompleted).

    public string[] SearchForMovie(string SearchParameter)
    {
        WebClientX.DownloadDataCompleted += WebClientX_DownloadDataCompleted;
        WebClientX.DownloadDataAsync(new Uri(uri));
    }
    
    void WebClientX_DownloadDataCompleted(object sender,
         DownloadDataCompletedEventArgs e)
    {
        Buffer = e.Result;
        string sitesearchSource = Encoding.ASCII.GetString(Buffer);
    }
    

    Also – don’t assume ASCII; WebClientX.Encoding would be better; or just DownloadStringAsync:

    static void Main()
    {
        var client = new WebClient();
        client.DownloadStringCompleted += DownloadStringCompleted;
        client.DownloadStringAsync(new Uri("http://google.com"));
        Console.ReadLine();
    }
    
    static void DownloadStringCompleted(object sender,
        DownloadStringCompletedEventArgs e)
    {
        if (e.Error == null && !e.Cancelled)
        {
            Console.WriteLine(e.Result);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public string GetArtistThumbnail(string artistName) { var request = WebRequest.Create(http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist= + artistName + &api_key= +
lot__no is a public string Dim myDelims As String() = New String() {<beginning of
public string[] tName = new string[]{Whatever,Doesntmatter}; string vBob = Something; string[] tVars = new
public string DefString { set; private get; } private string path = http://someuri.org/search?Par1=15&Par2=55; public
public class SomePropertyClass{ public string VarA{get;set;} public string VarB{get;set;} } SomePropertyClass v1 = new
public string getTime() { StringBuilder RetString = new StringBuilder(); RetString.Append(Hours.ToString().PadLeft(2, '0') + - +
public string[] arrTestResults = new string[8]; public string TestName; [TestInitialize] public void SetupTest() {
public string[] TestResults = new string[8]; I want to assign each item of the
public class Buddy { public string[] Sayings; } Buddy one = new Buddy(); one.Sayings
Given public String(char*) why we cannot use the following statement? string str = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.