DataGrid..?

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top