#2
apull2021-07-19 19:17
|
Imports System.Data.SqlClient
Public Class Form1
Private Conne As SqlConnection = New SqlConnection("Data Source=SWPDM\SWPDM;Initial Catalog=master;Integrated Security=True")
Private Sub adddate()
Dim cmd As SqlCommand
Dim cmdstring As String = ("insert CustomTemp(名称,规格,材料) value (" + CStr(TextBox1.Text) + ",'" + TextBox2.Text + ",'" + TextBox3.Text + ",")
cmd = New SqlCommand(cmdstring, Conne)
Conne.Open()
cmd.ExecuteNonQuery()
Conne.Close()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
adddate()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
End Class