Retreiving fields from DataSet causes errors

BenTam-3003 686 Reputation points
2022-02-06T14:44:34.267+00:00

Dear All,

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

171685-form.gif

C#
C#
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.
11,010 questions
0 comments No comments
{count} votes

Accepted answer
  1. P a u l 10,736 Reputation points
    2022-02-06T14:54:17.06+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.