小弟现在只会这样的做下面的代码``,可是小弟想把在上面图上在datagrid中的数据通过按销售按钮时会加载到销售表中,可是我不知道怎么弄才可以把上面的数据加载到销售表里面``请高手们帮帮小弟````
Module1.sqlconn.Open()
Try
Dim str As String
sqlCmd.Connection = Module1.sqlconn
str = "insert into 销售表(名称,尺寸,颜色,金额,数量) values ('" & txtShoesID.Text & "','" & CombNoID.SelectedItem & "','" & combColorID.SelectedItem & "','" & txtTotalMoney.Text & "','" & NumericUpDown2.Text & "')"
sqlCmd.CommandType = CommandType.Text
sqlCmd.CommandText = str
sqlDa.InsertCommand = sqlCmd
sqlCmd.ExecuteNonQuery()
MessageBox.Show("销售成功!", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show(ex.Message)
Module1.sqlconn.Close()
End Try
'还要修改的内容
If Module1.sqlconn.State <> ConnectionState.Open Then
Module1.sqlconn.Open()
End If