0

this is my code,

SqlConnection con = new SqlConnection(cs);
string query = 
              "select Student_Fees from Student_Table where Student_Fees=" + namecomboBox.SelectedValue;

SqlCommand cmd = new SqlCommand(query, con);

con.Open();
SqlDataReader dr = cmd.ExecuteReader();

var DataSet = new DataTable();
DataSet.Load(dr);


totalfeestextBox.Text = DataSet.Rows[0].ToString();

ill try all options. but not successfully.

abolfazl sadeghi
  • 2,277
  • 2
  • 12
  • 20
  • can you show error?do you check data DataSet.Rows? – abolfazl sadeghi Jul 08 '23 at 14:04
  • The first thing you need to do is [use parameters](https://stackoverflow.com/questions/7505808/). Next you need to [learn how to use a debugger](https://idownvotedbecau.se/nodebugging/). Then you need to [tell us the error message](https://idownvotedbecau.se/noexceptiondetails/). – Dour High Arch Jul 08 '23 at 14:32
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 09 '23 at 07:57

0 Answers0