Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Updating dataList question


Message #1 by judyn@s... on Sat, 15 Mar 2003 16:48:52 -0700
is it possible to fill a DataSet from the DataSource of a DataList? if so how?

Judy

Message #2 by "Penn White" <pennwhite@h...> on Sat, 15 Mar 2003 20:51:12 -0500
This might be what you are looking for.

Sub Whatever ()
  Dim connection As New SqlConnection(connectionString)
  Dim command As New SqlDataAdapter("NameOfStoredProcedure", connection)
  command.SelectCommand.CommandType = CommandType.StoredProcedure

  ' Initialize any parameters
  command.SelectCommand.Parameters.Add(New SqlParameter("@ParamName",
SqlDbType.Int))
  command.SelectCommand.Parameters("@ParamName").Value = 1

  Dim ds As DataSet = New DataSet()
  command.Fill(ds, "TableNameOrAnyOtherNameYouLike")
  DataGrid1.DataSource 
dsResults.Tables("TableNameOrAnyOtherNameYouLike").DefaultView
  DataGrid1.DataBind()
End Sub

----- Original Message -----
From: <judyn@s...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Saturday, March 15, 2003 6:48 PM
Subject: [aspx_beginners] Updating dataList question

> is it possible to fill a DataSet from the DataSource of a DataList? if so
how?
>
> Judy

  Return to Index