I need to search on name of teacher and display all information about it when user enter teacher name
I have wirrten this code but its given me run time error this error is: FATAL EXCEPTION: main
this is GetRecord method
public Cursor getRecord(String n1) throws SQLException
{
Cursor mCursor =db.query(true, databaseName, new String[] {facultyc,
deparmentc, namec, officeNumberc,Phonec ,emailAddressc,officeHourc},namec + "=" + n1, null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
and this search method, its perfom when user click on search button
public void search(){
db.open();
Cursor c = db.getRecord(n);
if (c.moveToFirst()){
t1.setText(c.getString(0));
t2.setText(c.getString(1));
t3.setText(c.getString(2));
t4.setText(c.getString(3));
t5.setText(c.getString(4));
t6.setText(c.getString(5));
t7.setText(c.getString(6));
}
else
Toast.makeText(this, "this Dr not found", Toast.LENGTH_LONG).show();
db.close();
}
this error appear
05-04 13:39:52.856: E/Trace(4001): error opening trace file: No such file or directory (2)