Langsung ke konten utama

CARA MEMBUAT FORM LOGIN SEDERHANA DENGAN KONEKSI DATABASE PADA C#

Pertama yaitu buat kelas Koneksi.cs dengan klik kanan pada project Anda => Pilih Add Class => Beri nama dengan Koneksi dan ketikkan kode berikut nama databasenya disesuaikan :
[csharp]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace KeretaApi
{
class Koneksi
{
static string conn;

public static SqlConnection Conn
{
get
{
return new SqlConnection(conn);
}
}

static Koneksi()
{
string connStr = "server=localhost;" +
"database=KeretaApi;" +
"Integrated Security=TRUE";
conn = connStr;
}
}
}
[/csharp]

Komentar

Postingan populer dari blog ini

sys.processes Status sp_who2 SQL Server

Taken from the books online reference for sys.processes  and the status column. dormant = SQL Server is resetting the session. running = The session is running one or more batches. When Multiple Active Result Sets (MARS) is enabled, a session can run multiple batches. For more information, see Using Multiple Active Result Sets (MARS). background = The session is running a background task, such as deadlock detection. rollback = The session has a transaction rollback in process. pending = The session is waiting for a worker thread to become available. runnable = The task in the session is in the runnable queue of a scheduler while waiting to get a time quantum. spinloop = The task in the session is waiting for a spinlock to become free. suspended = The session is waiting for an event, such as I/O, to complete.

ApexSQL Refactor SQL Server

Features ApexSQL Refactor Format SQL with over 160 options Qualify objects and expand wildcards Encapsulate SQL into procedures Add surrogate keys Replace one-to-many relationships Change procedure parameters Safely rename SQL objects Locate & highlight unused variables Format SQL objects Obfuscate SQL Link ApexSQL Refactor :  apexsql_refactor My Template xml ApexSQL Refactor