使用Looping Visual Studio无法检测到行

时间:2019-07-11 06:54:04

标签: loops helper rowcount

dt.Rows.Count找不到任何引用。

这是我的代码:

SqlCommand cmd = new SqlCommand("select WalletPoints from UsersInformation where Username = @Username", conn);
cmd.Parameters.AddWithValue("@Username", TbUsername.Text);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet dt = new DataSet();
da.Fill(dt);

for (int i = 0; i < dt.Rows.Count; i++) ;
{   
        int nrow;
        nrow = Convert.ToInt32(dt.Tables[0].Rows[5]["WalletPoints"].ToString());
        int Points = grandtotal();
        int TotalPoints = 0;

有人可以帮我吗?

0 个答案:

没有答案