Advertisement

07.24.2008 at 07:18AM PDT, ID: 23592153
[x]
Attachment Details

Handles clause requires a withevents variable defined within the container type or one of its base types

Asked by mconti41 in .Net Editors & IDEs, Visual Studio 2008, .NET Framework 3.x versions

I am trying to accomplish a simple SQL Insert to DB2 db table based on a button click event. I am including code for an experts review. I am desperate to resolve.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Aspx:
<asp:SqlDataSource ID="SqlDataSourceDependent" runat="server" 
              ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
              ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                      InsertCommand="INSERT INTO ENROLL.ENR02(E2GRP, E2SSN, E2DSSN, E2NAML, E2NAMF, E2NAMM, E2DOB, E2EFF, E2TRM, E2SEXC, E2RELC, E2QEVN, E2OTHI, E2FTS, E2FTSE, E2FTST) VALUES (,,,,,,,,,,,,,,,)">
               <InsertParameters>
                   <asp:QueryStringParameter Name="newparameter" QueryStringField="grpId" />
                   <asp:QueryStringParameter Name="newparameter" QueryStringField="memId" />
               </InsertParameters>
               
        </asp:SqlDataSource>  
        
         <table align="left"bgcolor="ffff99" width="75%">
               <tr bgcolor="ffff99">
				 <td colspan="4" align="center"><asp:Button ID="ButtonAddDepend" 
                         onclick="Dependent_Inserted" runat="server" Text="Add Dependent" 
                        Height="25px" Width="102px" 
                        /></td>
                        
			    </tr>
		</table>
 
Code Behind:
Protected Sub Dependent_Inserted(ByVal sender As Object, ByVal e As System.EventArgs) Handles Dependent.Inserted
 
        SqlDataSourceDependent.Insert()
 
    End Sub
[+][-]07.24.2008 at 07:23AM PDT, ID: 22079424

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:23AM PDT, ID: 22079439

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Visual Studio 2008, .NET Framework 3.x versions
Sign Up Now!
Solution Provided By: abel
Participating Experts: 1
Solution Grade: B
 
 
[+][-]07.24.2008 at 07:38AM PDT, ID: 22079616

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:49AM PDT, ID: 22079756

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628