Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i run the code error is giving

code
C#
Label8.Text = dataTable.Rows[0]("FullName").ToString();
                  Label12.Text = dataTable.Rows[0]("Email").ToString();


   Label8.Text=dataTable.Rows[0]("FullName").


in datatable.rows error is given method name expected....
Posted

Try:
C#
Label8.Text = dataTable.Rows[0]["FullName"].ToString();
Label12.Text = dataTable.Rows[0]["Email"].ToString();

Use square brackets instead of parentheses.

Hope this helps.
 
Share this answer
 
v2
Replace
C#
dataTable.Rows[0]("FullName")
With
C#
dataTable.Rows[0]["FullName"]


[edit]Typo - code block in wrong place[/edit]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900