表(湿法)values( "编号"  "日期"  "车型名称" "配方号""轮位" "批次号"  "班次")想做一个Winform界面 Button(更新) Button(查询) Lable(编号) textBox1 
下面是我做的ListView 显示数据的事例。
现在我想实现的是:通过查询的信息显示在ListView中,然后直接在ListView中更新数据,通过更新按钮实现。public class Form1 : System.Windows.Forms.Form
{
private static string strConnect = "workstation id=localhost;Integrated Security=SSPI;database=MyDb1";
private SqlConnection conConnection = new SqlConnection ( strConnect ) ; 
private ListView lv; 
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent(); //
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
// 初始化Form 
this.Left = 0 ; 
this.Top = 0 ; 
this.Text = "在ListView中显示数据库内容!" ;  // 初始化ListView 
lv = new ListView ( ) ; 
lv.Left = 0 ; 
lv.Top = 0 ; 
lv.Width = 700 ; 
lv.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
lv.Height = this.ClientRectangle.Height ; 
lv.GridLines = true ; 
lv.FullRowSelect = true ; 
lv.View = View.Details ; 
lv.Scrollable = true ;  lv.MultiSelect = false ; // 不可以多行选择 
lv.HeaderStyle = ColumnHeaderStyle.Nonclickable ; 
lv.Columns.Add ( "编号" , 60 , HorizontalAlignment.Right ) ; 
lv.Columns.Add ( "日期" , 100 , HorizontalAlignment.Left ) ; 
lv.Columns.Add ( "车型" , 100 ,  HorizontalAlignment.Left ) ; 
lv.Columns.Add ( "配方号" , 100 ,HorizontalAlignment.Left ) ; 
lv.Columns.Add ( "轮位" , 100 , HorizontalAlignment.Left ) ; 
lv.Columns.Add ( "批次号" , 100 ,HorizontalAlignment.Left ) ; 
lv.Columns.Add ( "班次" , 100 , HorizontalAlignment.Left ) ; 
lv.Visible = true ; 
                            SqlDataReader reader ; 
string strCommand = "SELECT * FROM 湿法" ; 
this.conConnection.Open ( ) ;
     SqlCommand cmd = new SqlCommand ( strCommand , conConnection ) ; 
reader = cmd.ExecuteReader ( ) ;
while ( reader.Read ( ) ) 

ListViewItem li = new ListViewItem ( ) ; 
li.SubItems.Clear ( ) ; 
li.SubItems[0].Text = reader["编号"].ToString ( ) ; 
li.SubItems.Add ( reader["日期"].ToString ( ) ) ; 
li.SubItems.Add ( reader["车型名称"].ToString ( ) ) ; 
li.SubItems.Add ( reader["配方号"].ToString ( ) ) ; 
li.SubItems.Add ( reader["轮位"].ToString ( ) ) ; 
li.SubItems.Add ( reader["批次号"].ToString ( ) ) ; 
li.SubItems.Add ( reader["班次"].ToString ( ) ) ; 
lv.Items.Add ( li ) ; 

reader.Close ( ) ;  
this.Controls.Add ( lv ) ; 
this.Closed+=new EventHandler ( this_Closed ) ; 
}
protected void this_Closed ( object sender , EventArgs eArgs ) 

this.conConnection.Close ( ) ; 
}  /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null) 
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
// 
// Form1
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(608, 398);
this.Name = "Form1";
this.Text = "Form1"; }
#endregion /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main() 
{
Application.Run(new Form1());
}
}
}