C# Adonet Kullanıcı Giriş Paneli ( C # User Input Panel Adonet)

C# Adonet Kullanıcı Giriş Paneli ( C # User Input Panel Adonet)

25. April 2009

Read this article in your language IT | EN | DE | ES

 

 

Adonet Kullanıcı Giriş Paneli

 

Gerekli İşlemler  :

 

1 > SQLSERVER New Database Diyip Eticaret Adında Bir  database  oluşturuyoruz  ardından bir Adet  Table  oluşturuyruz table

--------------------------------------------------------------

2 > Primary KEY Kesin Etkin yapıyoruz

ID int

UserName  varchar(50)

Password varchar(50)

Ardından  bu table  kullanicilar diye kayıt diyoruz

 

Insert İşlemi Yapıyoruz

 

insert into Kullanicilar (UserName,Password)

Values(Orhan,'123456')

 

3 > Sonra New Query Diyip Bir Store Produce Oluşturuyoruz

Store Produce Tanımlama İşlemi İçin Kodumuz

 

Create  Proc [UserControl]

@Adi varchar(50),

@Sifre Varchar (50)

As

Select * From dbo.Kullanicilar Where UserName=@Adi and Password=@Sifre

Evet Tüm İşlemler Bu Kadar artık    kodumuzu  yazıyoruz  ve projemizi hazırlıyoruz

 Windows Forms Üzerinde

2 Adet textBox

1 Adet Buton Atıyoruz

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

using LoginLibrary;

 

namespace LoginControl

{

    public partial class frmLogin : Form

    {

        public frmLogin()

        {

            InitializeComponent();

        }

        private void btngiris_Click(object sender, EventArgs e)

        {

               ///Connection Sınıfımız

            SqlConnection cnn = new SqlConnection(Connect.MyCnn);

            try

            {

//SqlCommand Blogumuz  Store Produce  Oluşturdumuz UserCntrol //proc Sqlcommand komut satırına yazıyoruz ve sonra conneciton //veriyoruz

                SqlCommand cmd = new SqlCommand("UserControl", cnn);

///Command type StoredProcedure B

                cmd.CommandType = System.Data.CommandType.StoredProcedure Belirtiyoruz

                cmd.Parameters.AddWithValue("@Adi", txanetUsername.Text);

                cmd.Parameters.AddWithValue("@Sifre", txtPassword.Text);

                cnn.Open();

 

/// ExecuteScalar ise geriye sonuç satırlarını

degil, sorgu sonucunda olusacak sonuç kümesinin ilk satırının birinci sütunudur.             

 int sayi = Convert.ToInt32(cmd.ExecuteScalar());

                cnn.Close();

                if (sayi > 0)

                {

                    frmMenu m = new frmMenu();

                    m.ShowDialog();

                }

                else

                {

                    MessageBox.Show("Kullanıcı Adı Şifre Yanlış");

                }

            }

            catch (SqlException ex)

            {

                MessageBox.Show(ex.Message + "Hata");

            }

            finally

            {

                cnn.Close();

            }

        }

    }

}

 

Proje Sunumu Bitmiş Hali Burdan İndirebilirsiniz

Evet Arkadaşlar  Gene Bir Makalenin  Sonuna Geldik Bu Makalede Sizlere  C# Adonet  2.0 Kullanıcı Giriş Nasıl Yaparız onu gördük

Tekrar  Yeni Bir Makalede Görüşmek Üzere

Saygılarımla Orhan Türk :

FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Ado Net , C# , ,

Comments

3/15/2010 11:26:15 PM #
Nice post. I have bookmarked it undoubtedly. decorating games
4/4/2010 4:46:51 AM #
I would agree all the way, but all in all great stuff.
4/6/2010 3:58:02 PM #
crafted a terrific piece of work. I be able to get stuff like this I really liked reading friend, and this kind of.
4/7/2010 12:13:24 AM #
This is one technology that I would love to be able to use for myself. It’s definitely a cut above the rest and I can’t wait until my provider has it. Your insight was what I needed. Thanks
4/7/2010 5:39:36 PM #
4/9/2010 8:40:01 PM #
Once again fantastic. come across stuff like this noticed homework, and always looking for.
4/13/2010 9:37:32 AM #
maybe you can help me get my blog set up?
5/17/2010 12:29:36 AM #
I be able to get stuff like this I really liked reading friend, and this kind of.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.015625 saniyede yuklendi.