A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_URI::$config is deprecated

Filename: core/URI.php

Line Number: 102

Backtrace:

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Router::$uri is deprecated

Filename: core/Router.php

Line Number: 128

Backtrace:

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$benchmark is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$hooks is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$config is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$log is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$utf8 is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$uri is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$exceptions is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$router is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$output is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$security is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$input is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$lang is deprecated

Filename: core/Controller.php

Line Number: 83

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$db is deprecated

Filename: core/Loader.php

Line Number: 397

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_DB_mysqli_driver::$failover is deprecated

Filename: database/DB_driver.php

Line Number: 372

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 10
Function: __construct

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$session is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 11
Function: library

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 6
Function: __construct

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$dcphpmailer is deprecated

Filename: core/Loader.php

Line Number: 1284

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 11
Function: library

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$model is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 13
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$categories is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 15
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$postcat is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 19
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$comment is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 23
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$user is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 27
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$coderunner is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 32
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$toc is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 37
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$data is deprecated

Filename: controllers/Blog.php

Line Number: 39

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 39
Function: _error_handler

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property blog::$meta is deprecated

Filename: core/Loader.php

Line Number: 359

Backtrace:

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 42
Function: model

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$load is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$state is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$userrole is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$user_id is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$benchmark is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$hooks is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$config is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$log is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$utf8 is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$uri is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$exceptions is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$router is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$output is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$security is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$input is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$lang is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$db is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$session is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$dcphpmailer is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$model is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$categories is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$postcat is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$comment is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$user is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$coderunner is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$toc is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$data is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Creation of dynamic property CI_Loader::$meta is deprecated

Filename: core/Loader.php

Line Number: 932

Backtrace:

File: /home/u1494823/public_html/deretcode/application/core/DC_Controller.php
Line: 33
Function: view

File: /home/u1494823/public_html/deretcode/application/controllers/Blog.php
Line: 77
Function: view

File: /home/u1494823/public_html/deretcode/start.php
Line: 315
Function: require_once

Menyimpan Data Image Di Database Sql Server Menggunakan Bahasa Pemrogramman VB.Net dan C#
Mode Malam
| Mode Tampilan
Penulis : admin

Home » Programming » Menyimpan Data Image Di Database Sql Server Menggunakan Bahasa Pemrogramman VB.Net dan C#
Menyimpan Data Image Di Database Sql Server Menggunakan Bahasa Pemrogramman VB.Net dan C#

Menyimpan Data Image Di Database Sql Server Menggunakan Bahasa Pemrogramman VB.Net dan C#


Kelebihan database Sql Server salah satunya adalah kemampuannya untuk dapat menyimpan data berupa gambar secara langsung(image type). Data yang disimpan sebenernya bentuk byte array, sehingga untuk menyimpan dan mengambil datanya perlu mengkonversinya.

advertisement

Menyimpan data berupa File Type baik itu gambar, video, suara, text dan lain sebagainya, sebenarnya tidak di sarankan. Hal ini dikarnakan akan memperlambat proses pembacaan database karena data tersebut memiliki length yang panjang. Bayangkan jika sistem tersebut di buat pada sisi server yang akan menangani banyak client, tentu akan sangat memberatkan kinerja server. Hal yang paling tepat untuk menyimpan data file type adalah dengan menyimpanya di directory server kemudian menyimpan alamat directory tersebut dalam database. 

Namun untuk pembelajaran, kali ini saya akan membagikan tutorial bagaimana cara menyimpan file gambar di Sql Server secara langsung. Oke kita langsung saja ke tutorialnya.

  1. Silahkan buat sebuah database Sql Sever dan kemudian eksekusi query berikut ini.
    create table simpan_gambar (id int identity primary key,nama varchar(150) not null, gambar image not null);
  2. Buat sebuah Project console aplikasi c# atau vb.net dan silahkan kalian copy paste code  berikut ini.
    Code vb.net
    Imports System.Data.SqlClient
    Imports System.IO
    'silahkan Add References System.Windows.Forms; Klik Menu Bar Project dan Klik Add References
    Imports System.Windows.Forms
    'silahkan Add References System.Drawing
    Imports System.Drawing
    Module Module1
        Sub Main()
            Dim file As New OpenFileDialog()
            file.Filter = "(*.JPG)|*.JPG"
            If file.ShowDialog = DialogResult.OK Then
                Dim image As Image = Image.FromFile(file.FileName)
                'Mengambil nama file gambar
                Dim namaGambar = Path.GetFileName(file.FileName)
                If SimpanGambar(image, namaGambar) Then
                    Console.WriteLine("Berhasil menyimpan")
                Else
                    Console.WriteLine("Gagal menyimpan")
                End If
                Console.ReadLine()
            End If
        End Sub
        Function SimpanGambar(ByVal image As Image, nama As String)
            Try
                'Ganti dengan koneksi database kalian'
                Dim con = New SqlConnection("DATA SOURCE=ANNAJIYAH\SQLEXPRESS;INITIAL CATALOG=BlogTest; USER ID=sa; PASSWORD=123")
                con.Open()
                Dim com = New SqlCommand("insert into simpan_gambar (nama,gambar) values(@name,@gambar)", con)
                'mengkonversi gambar ke bentuk byte array dengan fungsi ImageConverter
                Dim converter As New ImageConverter
                Dim array = converter.ConvertTo(image, GetType(Byte()))
                'Mengset data dengann fungsi Parametes AddWithValue Sqlcommand
                com.Parameters.AddWithValue("@name", nama)
                com.Parameters.AddWithValue("@gambar", array)
                con.Close()
                com.ExecuteNonQuery()
                Return True
            Catch ex As Exception
                MsgBox(ex.Message)
                Return False
            End Try
        End Function
    End Module

    Code csharp

    using System;
    using System.IO;
    //silahkan Add References System.Windows.Forms; Klik Menu Bar Project dan Klik Add References
    using System.Windows.Forms;
    //silahkan Add References System.Drawing;
    using System.Drawing;
    using System.Data.SqlClient;
    
    namespace SimpanGambar_csharp
    {
        class Program
        {
            [STAThread] //Atribut ini berfungsi mengijinkan multi thread pada OpenFIleDialog
            static void Main(string[] args)
            {
                var file = new OpenFileDialog();
                file.Filter = "(*.JPG)|*.JPG";
                if (file.ShowDialog() == DialogResult.OK)
                {
                    var img = Image.FromFile(file.FileName);
                    //Mengambil nama file gambar
                    var namaGambar = Path.GetFileName(file.FileName);
                    if (SimpanGambar(img,namaGambar))
                        Console.WriteLine("Berhasil di simpan");
                    else
                        Console.WriteLine("Gagal di simpan");
                    Console.ReadLine();
                }
            }
            static bool SimpanGambar(Image img,string nama)
            {
                try
                {
                    //Ganti dengan koneksi database kalian
                    SqlConnection con = new SqlConnection("DATA SOURCE=ANNAJIYAH\\SQLEXPRESS;INITIAL CATALOG=BlogTest; USER ID=sa; PASSWORD=123");
                    con.Open();
                    var com = new SqlCommand("insert into simpan_gambar (nama,gambar) values(@name,@gambar)", con);
                    //mengkonversi gambar ke bentuk byte array dengan fungsi ImageConverter
                    var converter = new ImageConverter();
                    var array = converter.ConvertTo(img, typeof(byte[]));
                    //Mengset data dengann fungsi Parametes AddWithValue Sqlcommand
                    com.Parameters.AddWithValue("@name", nama);
                    com.Parameters.AddWithValue("@gambar", array);
                    com.ExecuteNonQuery();
                    con.Close();
                    return true;
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return false;
                }
            }
        }
    }

    Sebelum menstorenya kedalam table, gambar harus di konversi ke dalam bentuk byte array dengan fungsi ImageConverter. Kemudian kita menset value dari query yang telah di buat dengan fungsi Parameters.AddWithValue SqlCommand.

Terimakasih sudah mampir di artikel cara menyimpan data gambar di sql server. Jangan lupa di share jika kalian merasa artikel ini bermanfaat, kalau ada pertanyaan silahkan tulis di kolom komentar. Good luck

advertisement

Tags: #vbnet #csharp #sqlserver
Bagikan :

Komentar:

Silahkan berkomentar dengan baik dan bijak!

Name * :
Email :
Website :
Comment :


This website uses cookies to ensure you get the best experience on our website

learn more