I've now spent a full day simply trying to get some data to my subreport. I'm using the following code, which seems to do absolutely nothing. What am I doing wrong??
Public
Sub
New
()
InitializeComponent()
End
Sub
Private
Sub
admin_invoice_details_ownitnow_NeedDataSource(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.NeedDataSource
Dim
SQL
As
New
StringBuilder
SQL.AppendLine(
" SELECT ISNULL(products.itemid, 0) AS lotid,"
)
SQL.AppendLine(
" invdesc.itemdesc,"
)
SQL.AppendLine(
" invdesc.amount"
)
SQL.AppendLine(
" FROM invdesc"
)
SQL.AppendLine(
" INNER JOIN products ON products.ProductID = invdesc.itemid"
)
SQL.AppendLine(
" WHERE invdesc.invoiceid = @invoiceid"
)
Dim
sqlDataSource1
As
New
SqlDataSource()
sqlDataSource1.ConnectionString = HttpContext.Current.Session(
"Conn"
)
sqlDataSource1.SelectCommand = SQL.ToString
sqlDataSource1.Parameters.Add(
"@invoiceid"
, DbType.Int32,
"=Parameters.invoiceid"
)
Me
.DataSource = sqlDataSource1
End
Sub