Public Sub Usr_mail(ByRef no As String)
Dim v_Type As String
Dim strEmail As String
Dim trans As SqlTransaction
Dim flag As Integer
'SQLtext = "select * from DCM_FOLD order by fold_na"
'Query String...
v_sql = "EXEC DOCN20A1_QRY "
v_sql = v_sql + " @doc ='" & no & "'"
With rsmail
If .State = ConnectionState.Open Then .Close()
.ActiveConnection = Conn1
.CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.LockType = ADODB.LockTypeEnum.adLockOptimistic
.Open(SQLtext)
End With
A_usr = ""
If rsmail.RecordCount > 0 Then
rsmail.MoveFirst()
Do Until rsmail.EOF
strEmail = rsmail.Fields("mst2code").Value
If Trim(rsmail.Fields("mst2code").Value) = "Error" Then
A_usr = ""
Else
A_usr = A_usr + Trim(rsmail.Fields("mst2code").Value)
A_usr = A_usr + ","
End If
rsmail.MoveNext()
Loop
End If
rsmail.Close()
'MsgBox (A_user)
'MsgBox A_usr, vbExclamation + vbOKOnly, "ข้อความเตือน"
End Sub
Dim objConn As New OleDbConnection
Dim objCmd As New OleDbCommand
Dim dtReader As OleDbDataReader
Dim strConnString,strSQL As String
Sub Page_Load(sender As Object, e As EventArgs)
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("database/mydatabase.mdb")&";Jet OLEDB:Database Password=;"
objConn.ConnectionString = strConnString
objConn.Open()
IF Not Page.IsPostBack() Then
ViewData()
End IF
End Sub
Sub ViewData()
'*** DataTable ***'
Dim dtAdapter As OleDbDataAdapter
Dim dt As New DataTable
strSQL = "SELECT * FROM customer WHERE CustomerID = '"& Request.QueryString("CustomerID") &"' "
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt)
If dt.Rows.Count > 0 Then
Me.txtCustomerID.Text = dt.Rows(0)("CustomerID")
Me.txtName.Text = dt.Rows(0)("Name")
Me.txtEmail.Text = dt.Rows(0)("Email")
Me.txtCountryCode.Text = dt.Rows(0)("CountryCode")
Me.txtBudget.Text = dt.Rows(0)("Budget")
Me.txtUsed.Text = dt.Rows(0)("Used")
End IF
End Sub