Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data
- Imports System.Data.OleDb
- Imports System.Data.SqlClient
- Public Class demoform
- Dim pass As String
- Dim user As String
- Dim dr As DataRow
- Dim dt As DataTable
- Dim dsResult As New DataSet
- Dim TableView As DataView
- Dim objDataAdapter As SqlDataAdapter
- Private Sub demoform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- LoginDialog.ShowDialog()
- Dim sConnection = "Server=PRESONIC-PC\FUNSQL;Database=pre_accounting;Uid=" & user & "; Pwd=" & pass & ";"
- objDataAdapter = New SqlDataAdapter("SELECT * FROM dbo.people", sConnection)
- If Not IsNothing(objDataAdapter) Then
- objDataAdapter.Fill(dsResult)
- TableView = dsResult.Tables(0).DefaultView
- dgvplay.DataSource = TableView
- End If
- End Sub
- Public Sub userpass_pass(ByVal the_user As String, ByVal the_pass As String)
- user = the_user
- pass = the_pass
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- objDataAdapter.Update(dsResult, dsResult.Tables(0).TableName)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement