本文介绍了如何在Com框中删除重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Com框中删除重复







//子类别

尝试

{

DataTable dt9 = new DataTable();

// string CS9 = ConfigurationManager.ConnectionStrings [DBCS ] .ConnectionString;



{

string query9 =从tblcatProducts中选择DISTINCT catName1;



SqlDataAdapter da9 = new SqlDataAdapter(query9,con2);

con2.Open();

DataSet ds9 = new DataSet();

da9.Fill(ds9,tblcatProducts);

comboBoxSub1.DisplayMember =catName1;

comboBoxSub1.ValueMember =catId;

comboBoxSub1.DataSource = ds9.Tables [tblcatProducts];

}

}

catch {}

How Can Remove Duplicate In The Com box



//Sub Category
try
{
DataTable dt9 = new DataTable();
//string CS9 = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

{
string query9 = "select DISTINCT catName1 from tblcatProducts ";

SqlDataAdapter da9 = new SqlDataAdapter(query9, con2);
con2.Open();
DataSet ds9 = new DataSet();
da9.Fill(ds9, "tblcatProducts");
comboBoxSub1.DisplayMember = " catName1";
comboBoxSub1.ValueMember = "catId";
comboBoxSub1.DataSource = ds9.Tables["tblcatProducts"];
}
}
catch { }

推荐答案


这篇关于如何在Com框中删除重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 20:07