Author: Norstar3 | Posted on: 9/3/2009 8:05:32 AM | Views : 324

I have been stumped by something that I believe to be easy, but I just cannot figure out how to solve.
On a webform, I have 21 SQLDataSources.  Also, I have 21 buttons: 1 for each data source that is in it's own gridview.  Each gridview has it's own View in a Multiview.
I am trying to use these buttons to fire the insert command of the respective datasource.  To minimize on coding, I am wanting 1 event to handle all 21 buttons.  I am running into a problem when I am trying to use a string/variable to refer to the sqldatasource control ID. The gridviews have the naming gv1, gv2, gv3, etc.  The datasources are named data1, data2, data3, etc. 


Here is my code:
Protected Sub NewBoxExtra(ByVal sender As Object, ByVal e As System.EventArgs) Dim controlSender As Control = DirectCast(sender, Control) 'Find the ID of the Gridview and create a string for the d ...

Go to the complete details ...