データベースからデータを取得して自分のフォームに挿入しようとしました。コードはWindowsフォームアプリケーションでデータベースからデータを取得中にエラーが発生しました
notificationList.Add(new notificationForm(
(String)dataset.Tables["alertdetails"].Rows[0]["memberName"],
(String)dataset.Tables["alertdetails"].Rows[0]["locationName"],
(String)dataset.Tables["alertdetails"].Rows[0]["photo"],
"",
(String)dataset.Tables["alertdetails"].Rows[0]["memberid"],
"",
"", x, y, alertId));
を行く私のnotificationFormの引数が
public notificationForm(String name, String location, String imageExtension,
String alertType,String memberid,String date,String time,
int x,int y,String alertid)
でエラーが型のオブジェクトをキャストすることができません
を行く '可能System.Int32' '可能System.String' を入力します。
私はmemberidを取得します。誰もそれを修正する方法を知っていますか?それはmemberName、locationNameと写真のためにうまくいきます。
はあなたに感謝します。できます! – Thomas