11 Reusable Code Snippet Topics
Remove Filter
|
|
I'm sure I've mentioned this type of wrapper class for accessing databases in a provider-agnostic manner before, but never posted a functional implementation. So here it is. Questions, comments, and suggestions are welcome as always. :) |
|
Earlier I posted a snippet which showed [how to create a 2 dimensional string array from an SQLite database table](https://www.daniweb.com/software-development/csharp/code/494083/sqlite-database-table-to-2-dimensional-string-array-). This snippet is the reverse, if you will, where we create an SQLite database table from a 2d string array. It should be noted that this code has it's limitations, … |
|
Here is a simple way to insert into a database that isn't much harder than using string concatenation - which we all know is very dangerous due to SQL injection attacks. Put the code snippet into `database.php`. Now, in a script handling a form post, such as `post_reply.php`: <?php require_once("database.php"); … |
|
If your Excel spreadsheet is laid out as regular columns and rows with a header row that identifies the columns then this code will allow you to read the data using ADODB the same way you would read records from a database table. To try this code 1. Create a … |
|
Several people have asked about storing binary data in a database. I coded up an example today that uses an ADODB.Stream to copy the binary data but after some fiddling I found a more direct way. If you are using MS SQL Server, the easiest way I have found is … |
|
Hi! This is my submission for code snippet contest. I also posted this code to help other members on how they can use compact & repair their MS Access Database within Visual Basic 6.0. You also need to add Microsoft Jet and Replication 2.6 in your project reference. To use, … |
|
I found an old thread that had never been answered here - [url]http://www.daniweb.com/software-development/vbnet/threads/330981[/url] Basically, the guy was asking how to retrieve database names and/or table names from a MySql database with vb.net. Here's my answer to that. Yes, I still use vb6 because vb.net is not much better and I … |
|
This is the simple code to read an image from the database. |
|
Code shows how to bind the data from a database`s table to dataTable and populate dataGridView with it. And then how to pass the modified (or not) data from dataGridView back to dataBase`s table. |
|
The code from my answer to thread: [url]http://www.daniweb.com/forums/thread292949.html[/url] Any field names with any same separator separating the values. This is straight text file reading routine, see the original thread for csv module based code. sample.dat: [CODE]id; name; email; homeaddress 123; gishi; gishi@mymail.com; 456 happy st. 345; tony; tony.veijalainen@somewhere.com; Espoo Finland … |
|
Hello, I've been working on this self-made database. What do you think about it? What features should I create for it? I'd also like to get help in a select method, because I don't have the foggiest idea how it could be done. And what about making it a database … |
The End.