//查询数据
public void selecetdata()//如果不是static 就要实例化才能调用 ,
{
try
{
string tablename;
tablename = "t_bd_item_cls";
if (cbtablename.Text == "类别资料")
{
tablename = "select item_clsno 类别编号,item_clsname 类别名称,profit_rate 毛利率 from t_bd_item_cls";
}
else if (cbtablename.Text == "商品资料")
{
tablename = "select * from t_bd_item_info";
}
string ConStr =
"server=" + tbip.Text + //数据库地址
"," + tbduankou.Text + //数据库端口
"; user id=" + tbuser.Text
public void selecetdata()//如果不是static 就要实例化才能调用 ,
{
try
{
string tablename;
tablename = "t_bd_item_cls";
if (cbtablename.Text == "类别资料")
{
tablename = "select item_clsno 类别编号,item_clsname 类别名称,profit_rate 毛利率 from t_bd_item_cls";
}
else if (cbtablename.Text == "商品资料")
{
tablename = "select * from t_bd_item_info";
}
string ConStr =
"server=" + tbip.Text + //数据库地址
"," + tbduankou.Text + //数据库端口
"; user id=" + tbuser.Text