Blog Of Sem: February 2019

windows 7 , 8 , 10 wifi sifresi görünmesin

regedit yönetici olarak çalıştır
export yap yedek alsın ne olur ne olmaz

bunu bul : {86F80216-5DD6-4F43-953B-35EF40A35AEE}

sağ tıkla ve yetki ayarla(permissin)
advanced owner change to computer name for example semspc

ok ok -

ve sil {86F80216-5DD6-4F43-953B-35EF40A35AEE}


VISUAL STUDIO C# SQL SERVER CONNECTION HELPER

using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;

namespace BMS_PDKS
{
    public class SQLHELPER
    {
        string baglanticumlesi = string.Format("Server={0}; Database={1}; User Id ={2};Password ={3}", CFG_TEMPLATE.CONFIG.LGDBSERVER, CFG_TEMPLATE.CONFIG.LGDBDATABASE, CFG_TEMPLATE.CONFIG.LGDBUSERNAME, CFG_TEMPLATE.CONFIG.LGDBPASSWORD);
        SqlConnection con;
        SqlDataAdapter adtr;
        public SqlConnection baglanti()
        {
            con = new SqlConnection(baglanticumlesi);
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            return con;
        }
        //public DataTable veri_getirme(string sqlcumle, DevExpress.XtraGrid.GridControl dtgrd)
        public DataTable GET_B_CAPIFIRM(GridControl dtgrdc,GridView dtgrdv)
        {
            DataTable dt = new DataTable();
            dtgrdv.Columns.Clear();
            try
            {
                using (adtr = new SqlDataAdapter("select * from B_CAPIFIRM", baglanti()))
                { adtr.Fill(dt); dtgrdc.DataSource = dt; }
            }
            catch (System.Exception ex) { MessageBox.Show(ex.Message); }
            return dt;
        }
        public DataTable GET_B_CAPIUSER(GridControl dtgrdc, GridView dtgrdv)
        {
            DataTable dt = new DataTable();
            dtgrdv.Columns.Clear();
            try
            {
                using (adtr = new SqlDataAdapter("select * from B_CAPIUSER", baglanti()))
                { adtr.Fill(dt); dtgrdc.DataSource = dt; }
            }
            catch (System.Exception ex) { MessageBox.Show(ex.Message); }
            return dt;
        }

    }
}
--

DAHA SONRA ANA FORMDA DEVEXPRESS GRIDVIEW YARAT VE ŞU ŞEKİLDE ÇAĞIR:
 
        SQLHELPER sqlhelper = new SQLHELPER();

        private void button1_Click(object sender, EventArgs e)
        {
            sqlhelper.GET_B_CAPIFIRM( gridControl1,gridView1);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            sqlhelper.GET_B_CAPIUSER(gridControl1, gridView1);
        }

C# SQL E TARIH AKTARIM UYGUN FORMAT

DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")


devexpress datetime component automove to next için
masktype 2 tane var ikisinde datetimeadvancingcaret yap



        public Form1()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;












ercanın kodlarda
            CultureInfo tr = new CultureInfo("tr-TR");

            Thread.CurrentThread.CurrentCulture = tr;

Unity 3d 5 admob google reklam ekleme

Önce indir ve unitye ekle: https://github.com/googleads/googleads-mobile-plugins/releases/latest
GoogleMobileAds.unitypackage




Sonra assetse Adscirit adında c# scripti yarat ve çift tıkla.


Notepad++ Plugin with Folder explorer treeview

https://notepad-plus-plus.org/repository/7.x/7.6/npp.7.6.Installer.exe

open folder as workspace

ve ftp plugin adminden indir nppftp

SQL SERVER TAKVIM TURKCE



  ALTER VIEW BM_TAKVIM AS
WITH Calender AS (
    SELECT CAST('2019-01-01' AS DATETIME) AS dt
    UNION ALL
    SELECT dt + 1 FROM Calender
    WHERE dt + 1 <=  CAST('2019-12-31' AS DATETIME)
)
SELECT
dt


,CASE
WHEN DATENAME (Month,dt)='January' THEN 'Ocak'
WHEN DATENAME (Month,dt)='February' THEN 'Şubat'
WHEN DATENAME (Month,dt)='March' THEN 'Mart'
WHEN DATENAME (Month,dt)='April' THEN 'Nisan'
WHEN DATENAME (Month,dt)='May' THEN 'Mayıs'
WHEN DATENAME (Month,dt)='June' THEN 'Haziran'
WHEN DATENAME (Month,dt)='July' THEN 'Temmuz'
WHEN DATENAME (Month,dt)='August' THEN 'Ağustos'
WHEN DATENAME (Month,dt)='September' THEN 'Eylül'
WHEN DATENAME (Month,dt)='October' THEN 'Ekim'
WHEN DATENAME (Month,dt)='November' THEN 'Kasım'
WHEN DATENAME (Month,dt)='December' THEN 'Aralık' ELSE '' END Ay
,CASE WHEN DATENAME (Weekday,dt)='Monday' THEN 'Pazartesi'
WHEN DATENAME (Weekday,dt)='Tuesday' THEN 'Salı'
WHEN DATENAME (Weekday,dt)='Wednesday' THEN 'Çarşamba'
WHEN DATENAME (Weekday,dt)='Thursday' THEN 'Perşembe'
WHEN DATENAME (Weekday,dt)='Friday' THEN 'Cuma'
WHEN DATENAME (Weekday,dt)='Saturday' THEN 'Cumartesi'
WHEN DATENAME (Weekday,dt)='Sunday' THEN 'Pazar' ELSE '' END Gün
,Hafta = DATEPART(WEEK, dt)  FROM Calender

 GO

  SELECT *
 FROM BM_TAKVIM WITH(NOLOCK)
 Option(MaxRecursion 0)

SQL SERVER DECIMAL TWO DIGIT

CONVERT(DECIMAL(10,2),sum(AMOUNT))
CONVERT(DECIMAL(10,2),PRICE)

devexpress splash screen

            SplashScreenManager.ShowForm(this, typeof(PROGRESSFORM), true, true, false);
            SplashScreenManager.Default.SetWaitFormCaption("LÜTFEN BEKLEYİN.");
            SplashScreenManager.Default.SetWaitFormDescription("");

------İŞLEMLER


            SplashScreenManager.CloseForm(false);
            MessageBox.Show("TAMAMLANDI", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

SQL SERVER BIRDEN FAZLA COLUMN DUBLICATE EKLEMESIN

ALTER TABLE [dbo].[PDKSEXCEL]   
ADD CONSTRAINT [UQ_SICILNO_TARIH_SAAT] UNIQUE NONCLUSTERED
(
    [SICILNO],   [TARIH],[SAAT]
)

DEVEXPRESS WCF GRIDVIEW UPDATE SQL

        private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            usersTableAdapter1.Update(bmS_SISTEMDataSet1);
        }