Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.24 KB | None | 0 0
  1. Imports System.Data
  2. Imports System.Data.OleDb
  3. Imports System.Data.SqlClient
  4.  
  5.  
  6. Public Class demoform
  7.     Dim pass As String
  8.     Dim user As String
  9.  
  10.     Dim dr As DataRow
  11.     Dim dt As DataTable
  12.     Dim dsResult As New DataSet
  13.     Dim TableView As DataView
  14.     Dim objDataAdapter As SqlDataAdapter
  15.  
  16.     Private Sub demoform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  17.  
  18.         LoginDialog.ShowDialog()
  19.  
  20.         Dim sConnection = "Server=PRESONIC-PC\FUNSQL;Database=pre_accounting;Uid=" & user & "; Pwd=" & pass & ";"
  21.  
  22.        
  23.         objDataAdapter = New SqlDataAdapter("SELECT * FROM dbo.people", sConnection)
  24.  
  25.  
  26.         If Not IsNothing(objDataAdapter) Then
  27.             objDataAdapter.Fill(dsResult)
  28.  
  29.  
  30.             TableView = dsResult.Tables(0).DefaultView
  31.             dgvplay.DataSource = TableView
  32.  
  33.         End If
  34.  
  35.  
  36.     End Sub
  37.  
  38.  
  39.     Public Sub userpass_pass(ByVal the_user As String, ByVal the_pass As String)
  40.         user = the_user
  41.         pass = the_pass
  42.     End Sub
  43.  
  44.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  45.         objDataAdapter.Update(dsResult, dsResult.Tables(0).TableName)
  46.  
  47.     End Sub
  48.  
  49. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement