16 Ocak 2018 Salı

Login Ekranı + SQL Connection String

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FirmaOtomasyonuDesktop
{
    public partial class fLogin : Form
    {
        public fLogin()
        {
            InitializeComponent();
        }

        private void biptal_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void bGiris_Click(object sender, EventArgs e)
        {
            kullaniciDenetle();
        }

        private void kullaniciDenetle()
        {
            string kullaniciAdi = eKullanıcıAdı.Text;
            string sifre = eSifre.Text;
            if (kullaniciAdi.Length <=0 || sifre.Length <=0)
            {
                MessageBox.Show("Kullanıcı adı veya Şifre Boş olamaz !", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            SqlConnection baglanti = new SqlConnection();
            baglanti.ConnectionString = "Data Source=127.0.0.1; Initial Catalog=HELLOSQL; User id=sa; Password=2002;";
            baglanti.Open();
            if (baglanti.State != ConnectionState.Open)
            {
                MessageBox.Show("Veri tabani Bağlantisi Sağlanamadi !", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                MessageBox.Show("Bağlantı Sağlandı !");
            }
        }
    }
}

Hiç yorum yok:

Yorum Gönder

Mac adres formatı excel

excel iki nokta mac addres formatı Mac adresi karakterlerini üst üste iki nokta : iki nokta üst üste olacak şekilde excel dosyasında ayırır....