Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I populate a DataList when I choose SELECT in a Gridview?

Status
Not open for further replies.

Curtis360it

IS-IT--Management
Nov 7, 2005
88
0
0
US
Basically, when someone clickes on a row in my Gridview, I would like to take a value from the Gridview and use it in a SPROC. That part works great, but I can't get my Datalist to populate correctly. I either get StackOverflowExceptions or nothing at all.

Can someone explain how I might go about doing what I am trying to accomplish?

EXAMPLE:
If IsPostBack Then
Dim value As String

Dim SqlDataSource As SqlDataSource
SqlDataSource = Me.Get_All_Details

value = Me.GridView1.SelectedRow.Cells(1).Text
SqlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("ESPConnectionString1").ToString

SqlDataSource.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
SqlDataSource.SelectCommand = "TenantDetailedInfo"
SqlDataSource.SelectParameters.Add("ID", value)

Me.DataList1.DataBind()

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top