VISUAL C# SQL AYNI KOD VARMI KONTROL

      private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection sqlConnection = new SqlConnection("Server = " + logoserver + "; Database = " + logodb + "; User Id = " + logouser + "; Password = " + logopass);




            using (SqlCommand sqlCommand = new SqlCommand("SELECT COUNT(*) from ZV_LOGO_HASTA where KODU = 112", sqlConnection))
            {
                sqlConnection.Open();
                int userCount = (int)sqlCommand.ExecuteScalar();
                if (userCount > 0)
                {
                    MessageBox.Show("BU KOD VAR");
                }
                else MessageBox.Show("BU KOD YOK");
            }
            sqlConnection.Close();
        }

Visual studio Projeni lisanslama olaylari

Özetle CryptoLicesnsi kur ve crackle sonra aç programı visual studioda proje yeni de refereransa cyrptolicensin kurulduğu klasörden LogicNP.CryptoLicensing.dll ekle. Ve cryptolicense programına geri geç project get validationdan kodunu al.
Google Drive\visual studio\cryptolisans\CryptoLicensingNet2015Enterprise.rar
Aşağıda serili ama tam calısmıyor
            string licOrSerial = “3SNK-JR68-VWR4-CU3U-DK5T-6M4Y-TGNU-W99Z”; // may be entered by user
            CryptoLicense lic = new CryptoLicense(“AMAAMACcdnLRtdM/BVep5vzxoSJkHW04yTbB6RBlL3AebAgDpcaAJ5m3ygqP8ueGL1ZQA1EDAAEAAQ==”);
            lic.LicenseServiceURL = “<>”;
            // Try to validate serial and retrieve license against the serial
            SerialValidationResult result = lic.GetLicenseFromSerial(licOrSerial);
            if(result == SerialValidationResult.Failed)
            {
                // ‘licOrSerial’ is in serial form but validation of serial failed
                MessageBox.Show(“Serial Validation Failed”);
                return;
            }
            elseif (result == SerialValidationResult.NotASerial)
            {
                // ‘licOrSerial’ is not a serial but may be a license, set lic.LicenseCode and validate it
                lic.LicenseCode = licOrSerial;
            }
            else//if (result == SerialValidationResult.Success)
            {
                // CryptoLicense.GetLicenseFromSerial set the lic.LicenseCode with the retrieved license code
                // validate it
            }
            // Validate license by querying Status property
            if(lic.Status != LicenseStatus.Valid)
            {
                MessageBox.Show(“License Validation Failed”);
                return;
            }
To start using CryptoLicensing for the licensing and copy-protection of your software, follow these simple steps:
In CryptoLicensing Generator:
  1. Start the CryptoLicensing Generator application from the Start Menu.
  2. Create a new license project : File menu –> Create New Project –> accept default settings by clicking OK button.
  3. Save the license project : File menu –> Save Project.
  4. Get the validation code for your project : Project menu –> Get Validation Key And Code.
  5. Generate a simple license code without any settings : simply click the Generate button. A new license code will be generated and displayed in the bottom textbox.
In Your Software Source Code Project:
  • Reference the LogicNP.CryptoLicensing.dll file from your project. This is the CryptoLicensing validation module. Note: For Silverlight, Windows Phone 7, or other kinds of projects, see Deploying Your Software for the exact assembly to reference.
  • At the top of your code file, add the following namespace declarations:
  using LogicNP.CryptoLicensing;
  • Write simple license validation code as follows:
    
            CryptoLicense lic = new CryptoLicense();
            lic.ValidationKey = “validation key obtained in step #4 above”;
            lic.LicenseCode = “license code generated in step #5 above”;
            // Validate the license using .Status property
            if (lic.Status != LicenseStatus.Valid)
                throw new Exception(“license validation failed”);

That’s it! Its that simple to start using CryptoLicensing for the licensing of your software.


Further Code Samples
The above code is a very simplistic code. Typically, you will not hard-code a license code in your software in the above manner, but load it as follows:
                      
                      
            // Load license from the registry
            lic.StorageMode = LicenseStorageMode.ToRegistry;
            if (lic.Load() == false)
                throw new Exception(“License could not be loaded”);
            // Validate the license using .Status property
            if (lic.Status != LicenseStatus.Valid)
                throw new Exception(“license validation failed”);

For the load method to succeed, there should be a previously saved license code in the first place. The license code is saved by calling the CryptoLicense.Save method in another part of your software which prompts the user for the license code. If you use the CryptoLicense.ShowEvaluationInfoDialog method to prompt the user for the license code, the dialog will automatically call the Save method for you.
If you are validating licenses requiring communication with the license service, make sure you specify the license service URL before validating the license code as follows:
                      
                      
            lic.LicenseServiceURL = “http://www.mysite.com/LicenseService/Service.asmx&#8221;
            // Validate the license using .Status property
            if (lic.Status != LicenseStatus.Valid)
                throw new Exception(“license validation failed”);

Further code samples demonstrating a variety of common licensing scenarios can be found in the Samples folder under the installation folder.
 
 
 

Visual c# ms sql database çifte kontrol

           SqlConnection connectionString = new SqlConnection("Server = " + ondegerler.SQLBAGLANTISI_KAYNAK + "; Database = " + ondegerler.SQLBAGLANTISI_VERITABANI + "; User Id = " + ondegerler.SQLBAGLANTISI_KULLANICI + "; Password = " + ondegerler.SQLBAGLANTISI_PAROLA);
            connectionString.Open();
            {




                SqlCommand sqlcom2 = new SqlCommand("select count(malzeme_kodu) from tbl_malzeme  where tbl_malzeme.malzeme_kodu = '" + Text_malzeme_kodu.Text + "'", connectionString);

                if (sqlcom2.ExecuteScalar() != null)
                {
                    int UserExist = (int)sqlcom2.ExecuteScalar();
                    if (UserExist > 0)
                    {
                        MessageBox.Show("Bu İsimde Malzeme Kodu Daha Önceden Yaratılmıştır!");
                    }
                }

gridview connect to ms sql with txt file query and get data to gridview with summary

  string connectionString = null;
            SqlConnection cnn;
            connectionString = "Server = " + ondegerler.SQLBAGLANTISI_KAYNAK + "; Database = " + ondegerler.SQLBAGLANTISI_VERITABANI + "; User Id = " + ondegerler.SQLBAGLANTISI_KULLANICI + "; Password = " + ondegerler.SQLBAGLANTISI_PAROLA;
            FileInfo file = new FileInfo(Application.StartupPath + "\\tbl_cariler.txt");
            string script = file.OpenText().ReadToEnd();
            cnn = new SqlConnection(connectionString);
            SqlDataAdapter da = new SqlDataAdapter(script, cnn);
            DataTable dt = new DataTable();
            da.Fill(dt);
            gridControl1.DataSource = dt;
            gridView1.Columns[1].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count;
            gridView1.Columns[1].SummaryItem.DisplayFormat = "Adet = {0}";

            gridView1.Columns["Bakiye"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
            gridView1.Columns["Bakiye"].SummaryItem.DisplayFormat = "Toplam = {0}";
            gridView1.BestFitColumns();

Devexpress grid databar

            GridFormatRule gridFormatRule = new GridFormatRule();
            FormatConditionRuleDataBar formatConditionRuleDataBar = new FormatConditionRuleDataBar();
            gridFormatRule.Column = gridView1.Columns[“Bakiye”];
            formatConditionRuleDataBar.PredefinedName = “Blue Gradient”;
            gridFormatRule.Rule = formatConditionRuleDataBar;
            this.gridView1.FormatRules.Add(gridFormatRule);

Devexpress gridview export to excel with savefiledialog

            string filename;
            saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx";
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();
            filename = saveFileDialog1.FileName;
            if (filename == "") filename = "";
            else
            {
                gridView1.ExportToXlsx(filename);
                System.Diagnostics.Process.Start(filename);
            }

vs 2013 c# Devexpress gridview sağ tıklayarak excel dosyası olarak kaydet

Forma 1 adet contextMenuStrip1 ve 1 adet saveFileDialog1 at gridControl1de ki dataları excele kaydetmek için;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;

contextMenuStrip1  tıkla Excele kaydet item yarat ve çift tıkla ve yaz;

            //excele kaydet
            string filename;
            saveFileDialog1.Filter = “xlsx files (*.xlsx)|*.xlsx”;
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();
            filename = saveFileDialog1.FileName;
            if (filename == “”) filename = “”; else gridView1.ExportToXlsx(filename);

Daha sonra gridcontrola tıkla ve contextmenustripini contextMenuStrip1 olarak seç

Visual C# 2013 Windows 7 Programa taskabara kısayollar ekleme IKONLU

 

 

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 Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;
using System.IO;
using System.Reflection;
using System.Diagnostics;







             private void Form1_Shown(object sender, EventArgs e)
        {
            //KISAYOLLAR DOSYA YOLLARI
            string VP = "D:\\Dosyalar\\semih\\visionpluskontrol32bit\\VisionPlusKontrol32bit\\VisionPlusKontrol32bit\\bin\\Debug\\VisionPlusKontrol32bit.exe";
            string OTOMASYON = "D:\\vs 2013 projeleri\\vp\\vpws\\vpws2\\EasyEkontor3g\\EasyEkontor3g\\bin\\Debug\\EasyEkontor3g.exe";
            string DOSTELWEB = "http://182.125.142.9/ws/";
            string DOSTELWEBICONIE = "C:\\Program Files\\Internet Explorer\\iexplore.exe";

            //SIK KULLANILANLAR DOSYA YOLLARI
            string COREL = "C:\\Program Files\\Corel\\CorelDRAW Graphics Suite X6\\Programs64\\CorelDRW.exe";
            string PHOTOSHOP = "D:\\Program Files\\Adobe\\Adobe Photoshop CC 2015\\Photoshop.exe";
            string DOSYALARVEBOYUTLAR = "D:\\Program Files (x86)\\WinDirStat\\windirstat.exe";
            string SEARCHEVERYTHING = "D:\\Program Files\\Everything\\Everything.exe";
            string SMSCASTER = "C:\\Program Files (x86)\\SMSCaster\\smscaster.exe";

            JumpList KISAYOLLAR = JumpList.CreateJumpList();
            KISAYOLLAR.ClearAllUserTasks();
            JumpListLink JLLVP = new JumpListLink(VP, "VP") { IconReference = new IconReference(VP, 0) };
            JumpListLink JLLOTOMASYON = new JumpListLink(OTOMASYON, "OTOMASYON") { IconReference = new IconReference(OTOMASYON, 0) };
            JumpListLink JLLDOSTELWEB = new JumpListLink(DOSTELWEB, "DOSTEL WEB") { IconReference = new IconReference(DOSTELWEBICONIE, 0) };
            JumpListCustomCategory kategori = new JumpListCustomCategory("KISAYOLLAR");
            kategori.AddJumpListItems(JLLVP);
            kategori.AddJumpListItems(JLLOTOMASYON);
            kategori.AddJumpListItems(JLLDOSTELWEB);
            KISAYOLLAR.AddCustomCategories(kategori);

            JumpListLink JLLCOREL = new JumpListLink(COREL, "COREL X6") { IconReference = new IconReference(COREL, 0) };
            JumpListLink JLLPHOTOSHOP = new JumpListLink(PHOTOSHOP, "PHOTOSHOP 2015") { IconReference = new IconReference(PHOTOSHOP, 0) };
            JumpListLink JLLDOSYALARVEBOYUTLAR = new JumpListLink(DOSYALARVEBOYUTLAR, "WINDIRSTAT DOSYA BOYUTLARI") { IconReference = new IconReference(DOSYALARVEBOYUTLAR, 0) };
            JumpListLink JLLSEARCHEVERYTHING = new JumpListLink(SEARCHEVERYTHING, "SEARCH EVERYTHING") { IconReference = new IconReference(SEARCHEVERYTHING, 0) };
            JumpListLink JLLSMSCASTER = new JumpListLink(SMSCASTER, "SMS CASTER") { IconReference = new IconReference(SMSCASTER, 0) };
            JumpListCustomCategory kategori2 = new JumpListCustomCategory("SIK KULLANILANLAR");
            kategori2.AddJumpListItems(JLLCOREL);
            kategori2.AddJumpListItems(JLLPHOTOSHOP);
            kategori2.AddJumpListItems(JLLDOSYALARVEBOYUTLAR);
            kategori2.AddJumpListItems(JLLSEARCHEVERYTHING);
            kategori2.AddJumpListItems(JLLSMSCASTER);
            KISAYOLLAR.AddCustomCategories(kategori2);
            KISAYOLLAR.Refresh();
        }