Compiler Error Message: BC30390: 'System.Data.SqlClient.SqlDataReader.Private Overloads Sub New(command As System.Data.SqlClient.SqlCommand)' is not accessible in this context because it is 'Private'.
What does this mean? All I want to do is read the value of 'ScanSetup' from this one record. (The orderID is the primary key.) Where am I going wrong folks? Thanks.
For the time being, I've simply included my VB code, not the HTML attached, because it's not in error. To test this out you may need to create a few labels.
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
' Insert page code here
'
Sub Page_Load()
Dim strConn, strSql, orderID, filmType, scanSetup AS String
orderID = Request.Form("OrderID"
Dim objData As New sqlDataReader
Dim objConn As SqlConnection
Dim objCom As SqlCommand
strConn = "server=Dell2400;database=DP2;uid=dp2user;password=dp2;"
strSql = "SELECT ScanSetup FROM Orders WHERE OrderID LIKE '" & orderID & "'"
objConn = New SqlConnection(strConn)
objCom = New SqlCommand(strSql, objConn)
Try
objConn.Open()
objData = objCom.ExecuteReader()
scanSetup = RTrim(objData("ScanSetup")
objData.Close()
objConn.Close()
Catch e as Exception
ErrorMsg.Text = e.ToString()
End Try
if NOT scanSetup = "" then
Select Case scanSetup
Case "WED LR 120/220 6x6 (SBA)"
filmType = "Wed6x6"
Case "WED LR 120/220 6x7 (SBA)"
filmType = "Wed6x7"
Case Else
ErrorMsg.Text = "There was no film type defined for this order."
End Select
end if
if IsPostBack then Label1.Text = "changes."
End Sub
</script>
What does this mean? All I want to do is read the value of 'ScanSetup' from this one record. (The orderID is the primary key.) Where am I going wrong folks? Thanks.
For the time being, I've simply included my VB code, not the HTML attached, because it's not in error. To test this out you may need to create a few labels.
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
' Insert page code here
'
Sub Page_Load()
Dim strConn, strSql, orderID, filmType, scanSetup AS String
orderID = Request.Form("OrderID"
Dim objData As New sqlDataReader
Dim objConn As SqlConnection
Dim objCom As SqlCommand
strConn = "server=Dell2400;database=DP2;uid=dp2user;password=dp2;"
strSql = "SELECT ScanSetup FROM Orders WHERE OrderID LIKE '" & orderID & "'"
objConn = New SqlConnection(strConn)
objCom = New SqlCommand(strSql, objConn)
Try
objConn.Open()
objData = objCom.ExecuteReader()
scanSetup = RTrim(objData("ScanSetup")
objData.Close()
objConn.Close()
Catch e as Exception
ErrorMsg.Text = e.ToString()
End Try
if NOT scanSetup = "" then
Select Case scanSetup
Case "WED LR 120/220 6x6 (SBA)"
filmType = "Wed6x6"
Case "WED LR 120/220 6x7 (SBA)"
filmType = "Wed6x7"
Case Else
ErrorMsg.Text = "There was no film type defined for this order."
End Select
end if
if IsPostBack then Label1.Text = "changes."
End Sub
</script>