Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strConn As String = "Data Source=VICKY03-MSFT;Initial Catalog=Xueyun;Integrated Security=True" 'Named a alias Larcolais for price column Dim strsql As String = "SELECT price AS Larcolais FROM parent WHERE startDate = '" & TextBox1.Text & "'" Dim conn As New SqlConnection(strConn) conn.Open() Dim cmd As New SqlCommand(strsql, conn) Dim reader As SqlDataReader = cmd.ExecuteReader 'begin reader reader.Read() 'if textbox2's text was greater than the current value of Larcolais column, the prompt window was occurred If TextBox2.Text > reader("Larcolais") Then MsgBox("alert") End If End Sub
Using connection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=H:\Computing\Year 13\Computing Project Course-work\Database41.accdb") Using command = New OleDbCommand("SELECT SUM(Distance) As Total FROM [Table3];", Conn) Dim total = Convert.ToInt32(command.ExecuteScalar) TextBox7.Text = total.ToString End Using End Using
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)