muratboy31 Posted June 11, 2015 Share Posted June 11, 2015 Arkadaşlar merhaba, bir konuda yardım aslında fikir almak istiyorum; ben yaptığım bir programı yaklaşık 10 pc üzerinde çalıştırmak istiyorum, program SQL server veri tabanı ile çalışıyor... Yalnız ben her client; timer ile zaman zaman güncelleme var mı diye bağlansın istemiyorum boşuna trafik oluyor. İstediğim sadece güncelleme olduğunda clientlar bağlansın ve verileri tekrar çeksin... Bu C# ta nasıl mümkün olur ? Teşekkürler Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted June 11, 2015 Editor Share Posted June 11, 2015 http://www.yazilimmutfagi.com/10024/windows/visual-cSharp-net/windows-form-uygulamalarini-iis-ile-nasil-publish-edebiliriz.aspx Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted June 11, 2015 Author Share Posted June 11, 2015 Sanırım yanlış anlattım... Program güncellemesi değil istediğim, veri tabanında bir güncelleme oldğunda tüm clientlarda otomatik güncellensin... mesela gridde satırlar var, başka bir client yeni kayıt eklediğinde hepsinde otomatik o kayıt görünsün... Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted June 11, 2015 Editor Share Posted June 11, 2015 O zaman timer koyarsın 1 dakikada bir verileri tekrar çeker listelersin. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted June 11, 2015 Author Share Posted June 11, 2015 onu istemiyorum aslında, java da messaging service gibi bişey var, client lara güncelleme yapması için mesaj gönderiyor... Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted June 11, 2015 Editor Share Posted June 11, 2015 O zaman her client in çalıştıgı zaman ip sini server a yollaması lazım ve server da veritabanında bir tetiklenme oldumu clientlara mesaj atması lazım. Client server mantıgına çevirmen gerekicek programı. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted June 11, 2015 Share Posted June 11, 2015 ben mdi formlarla çalışıyorum. Yani aynı anda birden çok açık pencere olabiliyor, 1 nolu pencerede yaptığım işlem, 2. nolu penceredeki kayıtları etkileyebiliyor. O yüzden verileri güncel tutmam gerekiyor. Aynı zamanda seninki gibi server client mantığı var. Çözümü şu şekilde buldum. Tüm pencerelerde kayıtlar direk form load ile değil Listele(); gibi bir fonksiyonla listeleniyor. Bende Form_Activated eventinde listeleme eventini koydum. Örneğin 1 nolu pencere seçildiğinde, aktif edildiğinde verileri tekrar listeliyor, bu sayede güncellenmiş oluyor aynı zamanda. Quote Link to comment Share on other sites More sharing options...
Bitmap Posted June 11, 2015 Share Posted June 11, 2015 socket connection yapabilirsin remooting kütüphaneleri vardı. Ayrıca istersen longpooling de yapabilirsin ama socket en sağlamı olur. sürekli istek atmak yerine socket aç bir tane, güncelleme olduğunda müdahale edebilirsn. yada observer pattern implementasyonu yapabilirsin. http://en.wikipedia.org/wiki/Observer_pattern Quote Link to comment Share on other sites More sharing options...
galetis Posted June 11, 2015 Share Posted June 11, 2015 http://www.codeproject.com/Articles/12335/Using-SqlDependency-for-data-change-events Yada değişiklik yaptığınız ana bilgisayara bir tcp server, kullanıcılarada tcp client kodu yazın. Ana makinede değişiklik olduğunda bağlı tcp kullanıcılarına ufak bir mesaj gönderin. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted June 11, 2015 Editor Share Posted June 11, 2015 http://www.codeproject.com/Articles/12335/Using-SqlDependency-for-data-change-events Yada değişiklik yaptığınız ana bilgisayara bir tcp server, kullanıcılarada tcp client kodu yazın. Ana makinede değişiklik olduğunda bağlı tcp kullanıcılarına ufak bir mesaj gönderin. SQL Dependency güzelmiş beğendim bilgi için teşekkürler galetis. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted June 11, 2015 Share Posted June 11, 2015 bilgi için tişikkirlir gilitis. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.