My output on SQL query is not viewing on my textbox, when the form load it must be automatically inserted to my textbox. The only output on my textbox is System.Data.SqlClient.SqlCommand
I don't know whats wrong or missing on my codes. Please help me, sorry I'm just a newbie on c#
Any type of response is greatly appreciated. Thank you in advance.
private void EmailGen_Load(object sender, EventArgs e)
{
connect.Open();
string emailto = "select emailaddress from emails where password = ''";
string emailfr = "select emailaddress from emails where password != null";
SqlCommand emailt = new SqlCommand(emailto, connect);
SqlCommand emailf = new SqlCommand(emailfr, connect);
emailt.ExecuteNonQuery();
txBEmailRec.Text = emailt.ToString();
txBEmailFr.Text = emailf.ToString(); ;
connect.Close();
// TODO: This line of code loads data into the 'kwemDataSet.tblProducts' table. You can move, or remove it, as needed.
this.tblProductsTableAdapter.Fill(this.kwemDataSet.tblProducts);
}