c# winform如何修改listview分列显示的内容并写入数据库。
2个回答
展开全部
1.先将LISTVIEW的VIEW属性改个details.
2.点编辑列 ,添加你的列
3.发点随便看看
private void button1_Click(object sender, EventArgs e)
{
string ip;
//string name;
string sql = "Data Source=127.0.0.1; initial Catalog=mysql;User ID=sa;Password=cqrb1234";
string sql2 = string.Format("SELECT * FROM IPMASTER");
SqlConnection conn = new SqlConnection(sql);
SqlCommand cmd = new SqlCommand(sql2,conn);
conn.Open();
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
}
2.点编辑列 ,添加你的列
3.发点随便看看
private void button1_Click(object sender, EventArgs e)
{
string ip;
//string name;
string sql = "Data Source=127.0.0.1; initial Catalog=mysql;User ID=sa;Password=cqrb1234";
string sql2 = string.Format("SELECT * FROM IPMASTER");
SqlConnection conn = new SqlConnection(sql);
SqlCommand cmd = new SqlCommand(sql2,conn);
conn.Open();
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询