Search the web
Sign In
New User? Sign Up
MapinfoTurkiye · Türkçe MapInfo Kullanýcý Yardim Sitesi
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [MapinfoTurkiye] Mapxtreme Desktop Uygulamasında Nesne Silme   Message List  
Reply | Forward Message #7260 of 7414 |
Ben silme isleminde asagidaki gibi bir kod kullandim ve boyle bir problem
yasamadim:


public static void deleteFeature(string table, string miKey) {
    try {
        using (MIConnection miconn = new MIConnection()) {
            using (MICommand micomm = miconn.CreateCommand()) {
                micomm.CommandText = "DELETE " + table + " WHERE
MI_KEY = '" + miKey + "'";
                miconn.Open();
                micomm.ExecuteNonQuery();
            }
        }
        activeMapControl.Refresh();
    }
    catch {
        MessageBox.Show("Hata oluştuğu için nesne silinemedi.", "Hata",
MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}


Kolay gelsin.

Mustafa Ozcetin

Arastirmaci / Yazilim Uzmani
TUBITAK UEKAE / G222 Birimi
Ataturk Bulvari No:211/20 Kavaklidere / ANKARA



--- On Thu, 7/9/09, mutlu1711 <mutlu1711@...> wrote:

From: mutlu1711 <mutlu1711@...>
Subject: [MapinfoTurkiye] Mapxtreme Desktop Uygulamasında Nesne Silme
To: MapinfoTurkiye@yahoogroups.com
Date: Thursday, July 9, 2009, 9:54 AM

merhaba,

MapXtreme ile Visual Studio 2008 ortamında geliÅtirmekte olduÄum bir
desktop uygulamasında;

Select Tool ile seçtiÄim nesneyi silmek için kullandıÄım buttona
tıklayınca seçtiÄim nesne o katmanda oluÅturulan ilk nesne deÄil ise
silme iÅlemi baÅarı ile eksiksiz gerçekleÅiyor. seçtiÄim nesnenin
katmanında o anda kaç tane nesne olursa olsun, seçilen nesne o katman
için üretilen ilk nesne ise silme iÅlemini sadece feature için
yapıyor. öznitelik bilgileri silinemiyor. silme iÅlemi için
yazdıÄım satırlar aÅaÄıdadır. katman için oluÅturulan ilk
nesnenin öznitelik bilgisinin neden silinemediÄi konusunda yardımcı
olursanız sevinirim.

kolay gelsin...

//p_mainlayer=seçili nesnenin hangi katmana ait olduÄu bilgisi
int rc=mapTableRowCount(p_mainLayer.ToString());  // seçili nesnenin
katmanında mevcut kaç tane row olduÄu tespit ediliyor.
MIConnection conn = new MIConnection(); conn.Open();
MICommand comm1 = new MICommand(); comm1.Connection = conn;
if (rc>1)
{
if (p_keyColumn.ToString() == "id") //bazı tablolarda ilk kolonun adı id
olmadıÄı için bunun kontrolü yapılıyor.
{
comm1.CommandText = "Delete from " + p_mainLayer.ToString() +
    " where " + p_keyColumn.ToString() + "=" + p_keyColumnValue.ToString();
}
else
{
comm1.CommandText = "Delete from " + p_mainLayer.ToString() +
    " where " + p_keyColumn.ToString() + "='" + p_keyColumnValue.ToString() +
"'";
}
}
else if (rc == 1)
{
comm1.CommandText = "Delete From " + p_mainLayer.ToString();
}
MIDataReader midr=comm1.ExecuteReader();
MapInfo.Data.Table table =
MapInfo.Engine.Session.Current.Catalog.GetTable(p_mainLayer.ToString());
table.Pack(MapInfo.Data.PackType.All);
comm1.Dispose();
conn.Close();
conn.Dispose();




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

---------------------------------------------
MapInfoTurkiye

Listeden çikmak için / To unsubscribe:
MapinfoTurkiye-unsubscribe@yahoogroups.com
Üye olmak için / To subscribe:
MapinfoTurkiye-subscribe@yahoogroups.com
Web Sayfasi: http://groups.yahoo.com/group/MapinfoTurkiye
Dosyalar: http://www.yahoogroups.com/group/MapinfoTurkiye/files/

NOT:Gruba gönderilen yazilardan sadece gönderen kisi sorumludur.
Yahoo! Groups Links








[Non-text portions of this message have been removed]




Fri Jul 10, 2009 5:24 am

mustafaozcet...
Offline Offline
Send Email Send Email

Forward
Message #7260 of 7414 |
Expand Messages Author Sort by Date

Ben silme isleminde asagidaki gibi bir kod kullandim ve boyle bir problem yasamadim: public static void deleteFeature(string table, string miKey) {     try...
Mustafa ÖZÇ...
mustafaozcet...
Offline Send Email
Jul 10, 2009
5:24 am

merhabalar, mustafa bey öncelikle ilginiz ve cevabýnýz için teþekkür ederim. fakat malesef ayný sorun devam ediyor....
mutlu1711
Offline Send Email
Jul 10, 2009
7:31 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help