#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    8
    Rep Power
    0

    "Value cannot be null. Parameter name: s"


    the following code is giving me the error "Value cannot be null. Parameter name: s":

    public static string NewSurveyPut(int nSurveyId)
    {
    SqlConnection myConn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
    string result;

    SqlCommand myCommand = new SqlCommand("sp_ApplicantSurveyPut", myConn);
    myCommand.CommandType = CommandType.StoredProcedure;

    SqlParameter sendSurveyId = myCommand.Parameters.Add(new SqlParameter("@SurveyID", SqlDbType.BigInt, 8));
    sendSurveyId.Value = nSurveyId;

    SqlParameter sendApplicantId = myCommand.Parameters.Add(new SqlParameter("@ApplicantID", SqlDbType.BigInt, 8));
    sendApplicantId.Value = System.DBNull.Value;

    myConn.Open();
    myCommand.ExecuteNonQuery();
    myConn.Close();
    }

    has anybody seen this before? i have a similar method that works fine, i don't understand why this one would be giving me a problem. thanks....
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    1
    Rep Power
    0

    Angry I have the same problem


    'Add any initialization after the InitializeComponent() call
    Me.SqlSelectCommand1.Parameters.Add("@thisID", SqlDbType.Int).Value = sourceID
    'The messagebox shows correct ID
    MessageBox.Show(sourceID.ToString)
    Me.editSource.Text = param2
    Me.editAuthors.Text = param3
    Try
    objdsFigure.EnforceConstraints = False
    Me.daFigure.Fill(objdsFigure, "Figure")
    Me.daFigure_Subject.Fill(objdsFigure, "Figure_Subject")
    'I guess the problem is this line. What could be wrong?
    objdsFigure.EnforceConstraints = True
    Catch colo As System.Exception
    MessageBox.Show(colo.Message)
    End Try

IMN logo majestic logo threadwatch logo seochat tools logo