TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Purba Anggara
NA
175
5.7k
Class FireBird Help me.
Apr 27 2016 8:39 PM
Example SQL connection
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Data;
using
MySql.Data.MySqlClient;
namespace
Perpustakaan
{
class
Example
{
}
class
DbMySQL
{
string ConnString ;
public
DbMySQL()
{
ConnString=
"DataSource=localhost;Username=root;password=;Database=db_perpus_ik3"
;
}
// -- jenis Query
// Query Pemilihan Data -> Select <namafield> FROM <namatabel> [WHERE kondisi]
public
DataTable GetDataTable(string Query)
{
DataTable result =
new
DataTable();
MySqlConnection MyConn =
new
MySqlConnection(ConnString);
MyConn.Open();
MySqlCommand MyComm =
new
MySqlCommand(Query, MyConn);
MySqlDataReader myReader = MyComm.ExecuteReader();
result.Load(myReader);
MyConn.Close();
return
result;
}
// Query Manipulasi Data
// -> tambah data > INSERT INTO <namatabel> (namafield1,namafield2,..) VALUES ('nilaifield1','nilaifield2',..)
// -> rubah data > UPDATE <namatabel> SET namafield='nilaifield',namafield2=nilaifield2,.. [WHERE kondisi]
// -> hapus data > DELETE FROM <namatabel> [where kondisi]
public
void
ExecuteNonQuery(string Query)
{
MySqlConnection myConn =
new
MySqlConnection(ConnString);
myConn.Open();
MySqlCommand myComm =
new
MySqlCommand(Query, myConn);
myComm.ExecuteNonQuery();
myConn.Close();
}
}
}
FireBird Class ??? Example ??? Please ???
Reply
Answers (
2
)
Why doesnt this work?
c# book(learning)