SQLCMD = " SELECT * FROM VSC_DOC_RUNNING_NO" + _
" WHERE DR_COMPANY ='" + LogonCompCode + "'" + _
" AND DR_BRANCH ='" + LogonBranchCode + "'" + _
" AND DR_DOC_TYPE ='PR' " + _
" AND DR_DOC_YEAR =" + DateTime.Now.ToString("yyyy") + ""
If (_conn.State = ConnectionState.Open) Then
_conn.Close()
End If
DbConnect()
Dim cmdSelect As New SqlCommand(SQLCMD, _conn)
Dim reader As SqlDataReader = cmdSelect.ExecuteReader
While reader.Read
End While
ช่วยแนะนำทีครับ ขอบคุณครับ
Tag : .NET, Ms SQL Server 2005, Win (Windows App), VB.NET
'*** DataTable ***'
Dim dtAdapter As SqlDataAdapter
Dim dt As New DataTable
strSQL = "SELECT * FROM customer WHERE CustomerID = '"& Request.QueryString("CustomerID") &"' "
dtAdapter = New SqlDataAdapter(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