Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Leaving function too early

$
0
0

Here is a function that I have written:

public DataSet GetMyData()
        {

        //  Note that a Fill() does not require a Connection Open/Close. The Fill() leaves the connection 
        //  in the state it was found (leaves it open if it was open, and
        //  if it was closed, it opens it, then closes it again).

            MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM customers", this.oConnection);
            da.Fill(this.ds, "dsCustomers");  

            DataTable dt = this.ds.Tables["dsCustomers"];

            MessageBox.Show("" + dt.Rows.Count.ToString());

            return ds;
        }

As soon as the fill method is called the program seems to stop. ie I never see the messagebox. 

Can anyone advise as to what might be causing this ?

Thanks,

John


jppnn


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>