connIMCL = New SqlConnection
With connIMCL
If .State = ConnectionState.Open Then .Close()
.ConnectionString = ConfigurationSettings.AppSettings("connIMCL")
.Open()
End With
sqlCmd = "Select UserName,StatusLevel From CHECK_POLICY Where Program ='Purchasing' AND UserName = '" & Session("Usr") & "'"
sqlCmd = "SELECT PODATE, PONO, POLINENO, DISCRIPTION, OTYORD, UOM, PRICE, CURRCODE, SUPPLIER_NAME, RECDATE, QTYREC, INVNo, DEPARTMENT "
sqlCmd &= " FROM GRN_PO"
sqlCmd &= " WHERE (INVNo = '" & tINVNo.Text & "' )"
Cmd = New SqlCommand
With Cmd
.CommandType = CommandType.Text
.CommandText = sqlCmd
.Connection = connIMCL
.ExecuteNonQuery()
End With
da = New SqlDataAdapter(sqlCmd, connIMCL)
ds = New DataSet
da.Fill(ds, "GRN_PO")
dvm = New DataViewManager
dvm.DataSet = ds
dvs = dvm.DataViewSettings("GRN_PO")
With grdINVNo
.Visible = True
.DataSource = dvm.DataSet
.DataMember = "GRN_PO"
.DataBind()
End With
If ds.Tables("GRN_PO").Rows.Count = 0 Then
lMess.Text = "No InvoiceNo. in this P/O or incorrect InvoiceNo.!!!"
lMess.Visible = True
Exit Sub
End If
End Sub
Server Error in '/IMCL' Application.
--------------------------------------------------------------------------------
[font=Verdana]Invalid object name 'GRN_PO'. [/font] Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'GRN_PO'.
Source Error:
Line 227: .CommandText = sqlCmd
Line 228: .Connection = connIMCL
Line 229: .ExecuteNonQuery()
Line 230:
Line 231: End With
Public Class AddGRN
Inherits System.Web.UI.Page
Dim sqlCmd As String
Dim connIMCL As SqlConnection
Dim Cmd As SqlCommand
Dim daCms As OdbcDataAdapter
Dim da As SqlDataAdapter
Dim ds As DataSet
Dim dt As DataTable
Dim dvm As DataViewManager