Retreiving fields from DataSet causes errors

BenTam-3003 686 Reputation points

Dear All,

Four errors are found in the following screen capture. Could anybody tell me how to fix it?


An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,223 questions
0 comments No comments
{count} votes

Accepted answer
  1. P a u l 10,406 Reputation points

    If you change those single quotes for double quotes then it should fix the syntax error. You'll also need to .ToString() the columns to get the values though:

    M_Name = ds1.Tables["Student_table"].Rows[0]["Name"].ToString();
    M_Remark = ds1.Tables["Student_table"].Rows[0]["Remark"].ToString();

    Sorry - I missed your reply to the topic yesterday but it's best to bump the old topic rather than creating a duplicate to avoid spam.

    0 comments No comments

0 additional answers

Sort by: Most helpful