- 博客(0)
- 资源 (1)
空空如也
美淘管理平台.sln
一个简单的winform项目
Hotel();
Foods();
Travel();
KTV();
if (this.cb_Type.Text == "全部类型")
{
//创建链接对像
SqlConnection Conn = new SqlConnection(DBHelper.ConnectionString);
//打开连接
Conn.Open();
//执行sql语句
string sqlStr = "select * from Product";
//创建命令对象
SqlCommand cmd = new SqlCommand(sqlStr, Conn);
//执行命令
SqlDataReader reader = cmd.ExecuteReader();
//读取
this.listView1.Items.Clear();
while (reader.Read())
{
ListViewItem item = new ListViewItem(reader["ProductID"].ToString());
item.SubItems.Add(reader["ProductName"].ToString());
item.SubItems.Add(reader["ProductPrice"].ToString());
this.listView1.Items.Add(item);
}
reader.Close();
//关闭
Conn.Close();
}
2015-06-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人