Hi @BenTam-3003 , Welcome to Microsoft Q&A,
This is an unnecessary and important problem. Also, if you don't need to use the screen, this will be a disadvantage to you.
When you look at the problem, you don't have to use DataRow in ds.Table[0], and you don't have to use DataRow in ds.Table[0].
Normal case example:
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(SelectQuery, connection);
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds, "Student");
DataTable dt = ds.Tables["Student"];
if (dt.Rows.Count > 0)
{
DataRow r = dt.Rows[0];
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.