Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

android - Database to create a database -


i'm using sqlite android develop , app can customizable (for dev) in future. have created database data used create database application. if changes need made in future or write app else in future have change original database. idea behind dev's database set ui , app.

i stuck on next have database need in app dev populated. idea create dbhelper class , within reference original dbhelper class , query within new db class. second dbhelper class i'm trying create database previous database:

public class appdbhelper extends sqliteopenhelper {     private static final string database_name = "library.db"; //database name        cursor all, tables, options, ui_type;     sqlitedatabase database;      public appdbhelper(context context) {         super(context, database_name, null, 1);         dbhandler databasehelper = new dbhandler(context);         database = databasehelper.getreadabledatabase();         = database.rawquery("select * config", null);         tables = database.rawquery("select * table_names", null);         options = database.rawquery("select * options", null);         ui_type = database.rawquery("select * ui_type", null);     }      @override     public void oncreate(sqlitedatabase db) {         for(int i=0; i<tables.getcount(); i++){             tables.movetoposition(i+1);             string sql = "";             for(int j = 0; < all.getcount(); j++){                 if (all.movetofirst()) {                     do{                         sql = ", " + all.getstring(2) + " " + all.getstring(5).touppercase();                     }                     while (all.movetonext());                 }             }              log.v("databasesql", sql);             database.execsql( "create table " + tables.getstring(1) + "(_id integer primary key autoincrement"+sql+");");         }     } 

but have feeling not way go need do. appreciated.

i think wrong , complicated. provide database read data create inserts , configuration implemented.

two solutions:

  1. from own project: databaseadapter.oncreate()

    there should see database setup , filling of database data. data added simple inserts contains data based on constants. programmer can change data changing constants.

    with don't have handle 2 databases, don't need provide database , read them.

  2. as android supports database locations skip , open sqlite database file provide in res/raw or asset folder or anywhere on sdcard.

i recommend 1 of 2 ways mentioned above.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -