4 Textbox
4 Textbox
SqlClient
Public Class Form1
Dim con As New SqlConnection("Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=student study;Data Source=DESKTOP-A5IN5UO\SQLEXPRESS")
Dim cmd As New SqlCommand("select * from study", con)
Dim dt As New DataTable
Dim da As New SqlDataAdapter(cmd)
Dim df As New SqlCommandBuilder(da)
Dim mx As Double = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////
��� ���
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If con.State = Data.ConnectionState.Closed Then con.Open()
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or
TextBox4.Text = "" Then
MsgBox("������ ����� ������")
Exit Sub
End If
Dim cmd As New SqlCommand("insert into study values(" & Val(TextBox1.Text)
& ",'" & Trim(TextBox2.Text) & "','" & Trim(TextBox3.Text) & "','" &
Trim(TextBox4.Text) & "')", con)
cmd.ExecuteNonQuery()
MsgBox("�� �����")
End Sub
///////////////////////////////////////////////////////////////////////////////////
/////////////
��� ���
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
If con.State = ConnectionState.Closed Then con.Open()