Micro sd card, arduino due

i have made a device using arduino..
here i write data in micro sd card..
everything doing good. but some times sd card got error...
after 10/15 min running sd card fault. i change sd card.. but the problem is not solved...

Difficult to assist on the information provided.

You need to tell us the type of micro SD card you are using, how its wired etc.

Then perhaps tell us the exact error you get etc.

Posting a schematic, not a frizzy thing will help a lot, show all power and ground connections. Is anything getting warm? Try putting the SD card in a cool place for about 1/2 hour and see if it works ok for a while, let us know.

thanks all
for replying. i found the problem. might be hardware issue. then i reprogram it.
my device will restart when micro sd card got error. (problem solved)

It would help others, who may have the same problem, if you explain how you sorted it ?

connect (pin 2) with (reset pin)
at the data storage
else {

  Serial.println("error opening datalog.txt");
  sdstatus = "SD error, Reseting.";
   digitalWrite(rstPin, LOW);
  
} 

by this. your device will reset when the problem occur.

Did you figure out what the error was or why it occurred?

So you are initiating a complete reset of your device when this error occurs?

yes