Welcome to

w3study.github.io




Topics

CRUD Operation in SQLite Database in Hindi

Create Operation

Read Operation

Update Operation

Delete Operation



CRUD Operation in SQLite Database in Hindi (Android)


CRUD Operations in SQLite Database

CRUD का मतलब Create, Read, Update, और Delete होता है, जो किसी database में data manage करने के लिए सबसे जरूरी operations हैं। Android में SQLiteOpenHelper class की मदद से CRUD operations को implement किया जाता है।

1. Create (Insert Data)

Database में नया record जोड़ने के लिए insert() method का उपयोग किया जाता है।

java

public void insertData(String name, int age) {
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues values = new ContentValues();
    values.put("name", name);
    values.put("age", age);
    db.insert("students", null, values);
    db.close();
}

2. Read (Fetch Data)

Database से data retrieve करने के लिए query() या rawQuery() का उपयोग किया जाता है।

java

public Cursor getAllData() {
    SQLiteDatabase db = this.getReadableDatabase();
    return db.rawQuery("SELECT * FROM students", null);
}

3. Update (Modify Data)

Existing record को update करने के लिए update() method का उपयोग किया जाता है।

java

public void updateData(int id, String newName, int newAge) {
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues values = new ContentValues();
    values.put("name", newName);
    values.put("age", newAge);
    db.update("students", values, "id=?", new String[]{String.valueOf(id)});
    db.close();
}

4. Delete (Remove Data)

किसी record को delete करने के लिए delete() method का उपयोग किया जाता है।

public void deleteData(int id) {
    SQLiteDatabase db = this.getWritableDatabase();
    db.delete("students", "id=?", new String[]{String.valueOf(id)});
    db.close();
}

Basic of Content Provider in Hindi


Development of Android Applications Notes in Hindi



Request:

हैलो दोस्तों! उम्मीद करता हूं आपको हमारा यह content/post पसंद आया होगा। अगर आपको हमारा ये content/post पसंद आई हो तो अपने दोस्तों के पास भी share करे। और अगर आपको कोई problem या कोई specific content हिन्दी में चाहिए है तो आप हमें नीचे दिए गए Email या whatsapp number के जरिए बता सकते है।

अगर आप CCC/diploma/polytechnic/MCA/BCA etc कर रहे है तो ये website स्पेशली आपके लिए ही है, जो student हिंदी में पढ़ाई करते है।

Contact Us

Email: deepanshuranjan8057@gmail.com

Whatsapp: +91 8057754706



Follow Us

Facebook Logo    Instagram Logo


Introduction to Android in Hindi


Dalvik Vartual Machine in Hindi


Basic Building Blocks in Android in Hindi


Fundamentals of android in Hindi


apk file extension in Hindi


UI components in Hindi


Components for communication in Android in Hindi


Android API Levels in Hindi


Setting up development environment in Hindi


Manifest.xml in Hindi


Resources & R.java in Hindi