Cần sửa câu lệnh sao để phù hợp với kiểu int?

int maphieumuon = dataGridView1.SelectedCells[0].OwningRow.Cells["maphieumuon"].Value.ToString();

cần sửa câu lệnh sao cho nó phù hợp với kiểu int em tìm ko ra

int.Parse();

Nhiều cách tại đây: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/how-to-convert-a-string-to-a-number

2 Likes

dùng Parse để convert string
Dùng Convert.ToInt32() để convert được nhiều thứ hơn string

2 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?