Showing posts from September, 2014 insert datatable into the database using dataadapter insert datatable into the database using dataadapter : To do this your datatable schema to be inserted should match with table schema of database. It will work on all database connection string:

Assuming said above your datatable is dtc then call insertTableinDB(dtc, "teamMaster")

PublicSharedFunction insertTableinDB(ByVal dt AsDataTable, ByVal mytablename AsString) AsString

'Create Connection StringDim myquery = "select * from " & mytablename & " limit 1"Using connection AsNewSQLiteConnection(System.Configuration.ConfigurationManager.ConnectionStrings("vindb").ConnectionString)
Try'connection.Close()                connection.Open()'' sqlComm = New SQLiteCommand("select * from gamemaster", connection)Dim da AsNewSQLiteDataAdapter(myquery, connection)Dim dcmd AsSQLiteCommandBuilder = NewSQLiteCommandBuilder(da)                da.MissingSchemaAction = MissingSchemaAction.AddWithKey                da.Update(…

Portable database : Sqlite with

Problem: Unable to load sqlite.dll
Solution: Add from Nuget package both for x64 and x86

problem: Unable to open database (sqlite) in
solution : In IIS7 it simply fails with the Unable to open the database file error, ihmo because it tries to write to the Temporary ASP.NET Files folder.. use |DataDirectory| in path like this

Most of applications we develop on .NET in a professional way use to imply the existence of a database, usually SQL Server, Oracle, DB2 or MySQL. Nevertheless, sometimes, even we need database support, it's not necessary to mantain a database manager, because its portability, licensing, data volume and complexity...

In Android, each application uses a single local SQLite database. Why not applying the same philosophy to a .NET application? Well, it's possible to encapsulate the database in a .db file inside a local directory on the same way Android applications do. Let's see now how to install SQLite for .NET and programming a little applicati…

Google+ Followers