Results 1 to 2 of 2

Thread: missing sqlparameter add method

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    617

    missing sqlparameter add method

    Hi guys, Im trying to follow this sample of inserting data through gridview rowcommand. But somehow Im missing the sqlparameter add method whilst the namespace was already added.


    Code:
     
    
    //sqlparameter declaration of list type
     private List<SqlParameter> insertParameters = new List<SqlParameter>();
    
    
    mygridview_rowcommand(...){
     SqlParameter _prm_guid = new SqlParameter("@pk_guid", SqlDbType.VarChar);
     _prm_guid.Direction = ParameterDirection.Input;
     _prm_guid.Value = thisguid;
               
      insertParameters.add(?); //error on add()
    
    }
    Some other part of the code which related to insertParameters variable it give an error
    Code:
    for statement cannot operate on variables of type List<System.Data.SqlClient.SqlParameter> because List<System.Data.SqlClient.SqlParameter> does not contain a public definition of GetEnumerator
    Am I missing a file reference? Appreciate an help.
    Last edited by jlbantang; Sep 29th, 2012 at 03:55 PM.
    Learn something new every .001 second.

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: missing sqlparameter add method

    insertParameters.add(_prm_guid);

    Did you try the above one?
    Please mark you thread resolved using the Thread Tools as shown

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width