attempting to retrieve some data in the database and set in into my form. the code goes

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));

the arguments for my notificationForm is

public notificationForm(String name, String location, String imageExtension,
                        String alertType,String memberid,String date,String time,
                        int x,int y,String alertid)

the mistake goes

Not able to cast object of type 'System.Int32' to type 'System.String'.

at risk whereby i retrieve memberid. anybody understand how to fix that? it really works acceptable for memberName, locationName and photo though.

dataset.Tables["alertdetails"].Rows[0]["memberid"]

provides you with the integer value, when the datatype of memberid within the database is int. Then, either add ToString() in the finish or cast it for an int.

Example:

dataset.Tables["alertdetails"].Rows[0]["memberid"].ToString()
                      OR
Convert.ToInt32(dataset.Tables["alertdetails"].Rows[0]["memberid"]) 

Cast it for an int (32bit integer), that is exactly what the error message is suggesting.

Check the kind of 'memberid' column within the database table. Most probably it's an integer.