private DataTable getmeaning(text1)
{
DataTable dt = new DataTable();
dt.Columns.Add("mean", typeof(string));
if (conn.State.ToString() == "Closed")
{
conn.Open();
}
SqlCommand newCmd = conn.CreateCommand();
newCmd.Connection = conn;
newCmd.CommandType = CommandType.Text;
newCmd.CommandText = "select mean from [audio1] where word = ' " + text1 + " ' ;";
SqlDataReader dr = newCmd.ExecuteReader();
while (dr.Read())
{
dt.Rows.Add(dr["mean"]);
}
conn.Close();
return dt;
}
then call the method like this....
DataTable dt = getmeaning(textBox1.Text);
if(dt.Rows.Count > 0)
{
DataView dv = new DataView(dt);
textBox2.Text = dv[0]["mean"].ToString();
}