K
Kent Johnson
Hi all,
I'm using VS.Net and have put a simple Datagrid on a Webform.
I have a SqlConnection, DataAdapter and a Dataview.
In design mode I can see the columnnames and some data. I can also preview
the data from Data/Preview data. In the Page_Load event I have:
=======================================================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.SelectCommand.Parameters(0).Value _
= context.User.Identity.Name()
SqlConnection1.Open()
SqlDataAdapter1.Fill(DataSet11, "TblSystTransp1")
SqlConnection1.Close()
DataGrid1.DataSource =
DataSet11.Tables("TblSystTransp1").DefaultView
DataGrid1.DataBind()
End Sub
=========================================================
But when I run the Webform I get the error:
Invalid index 0 for this SqlParameterCollection with Count=0.
What can be wrong?
/Kent J.
I'm using VS.Net and have put a simple Datagrid on a Webform.
I have a SqlConnection, DataAdapter and a Dataview.
In design mode I can see the columnnames and some data. I can also preview
the data from Data/Preview data. In the Page_Load event I have:
=======================================================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.SelectCommand.Parameters(0).Value _
= context.User.Identity.Name()
SqlConnection1.Open()
SqlDataAdapter1.Fill(DataSet11, "TblSystTransp1")
SqlConnection1.Close()
DataGrid1.DataSource =
DataSet11.Tables("TblSystTransp1").DefaultView
DataGrid1.DataBind()
End Sub
=========================================================
But when I run the Webform I get the error:
Invalid index 0 for this SqlParameterCollection with Count=0.
What can be wrong?
/Kent J.