On 10 May 2010 22:37, Soo Kim <[email protected]> wrote:

> Is that done in the asp or vb side?  So how is the code supposed to look
> like?
>
>
> On Sat, May 8, 2010 at 7:18 AM, Stephen Russell <[email protected]>wrote:
>
>>  On Fri, May 7, 2010 at 3:14 PM, shookim <[email protected]> wrote:
>>
>> > -----vb code----
>> > Sub BindData()
>> >
>> >       Dim strSqlConnection As String =
>> > ConfigurationManager.AppSettings("ConnectionString")
>> >       Dim strSqlStatement As String
>> >       Dim sqlConn As SqlConnection
>> >       Dim dsAdSignup As New DataSet
>> >       Dim objDS = New DataSet
>> >
>> >       objDS.DataSetName = "dsAdSignup"
>> >       sqlConn = New SqlConnection(strSqlConnection)
>> >
>> >       strSqlStatement = "select * from tblAdSignup"
>> >
>> >      Dim cmd As SqlCommand
>> >       Dim dataAdapter As New SqlDataAdapter
>> >
>> >       cmd = New SqlCommand(strSqlStatement, sqlConn)
>> >
>> >       dataAdapter.SelectCommand = cmd
>> >       dataAdapter.Fill(dsAdSignup)
>> >       GridView1.DataSource = dsAdSignup
>> >       GridView1.DataBind()
>> >
>> >   End Sub
>> >
>> >  Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e
>> > As GridViewUpdateEventArgs)
>> >
>> >       ID = GridView1.DataKeys(e.RowIndex).Value
>> >       Dim txtAddress As String
>> >       txtAddress =
>> > CType(GridView1.Rows(e.RowIndex).FindControl("txtAddress"),
>> > TextBox).Text  <----this is where it bombs
>> >
>> > End Sub
>> >
>> >
>> > -------END CODE------
>> >
>> > txtAddress =
>> > CType(GridView1.Rows(e.RowIndex).FindControl("txtAddress"),
>> > TextBox).Text  is where it is bombing, help!
>> >
>>
>> In your Sub method there is no knowledge of e.RowIndex.  That value
>> has to be passed TO BindData(RowNumber)
>>
>>
>>
>>
>>
>>
>> --
>> Stephen Russell
>>
>> Sr. Production Systems Programmer
>> CIMSgts
>>
>> 901.246-0159 cell
>>
>
>


-- 
********************************************************************************************************************************************************************

Regards
S..Sathesh Kumar
Mobile: 9600896905

Reply via email to