+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Safari/Firefox Mac Issue

Safari/Firefox Mac Issue

5 posts, 0 answered
  1. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    03 Aug 2010
    Link to this post
    I'm having a very strange issue where a chunk of code that runs fine everywhere else fails only on machine that are Mac (Leopard) running safari or Firefox.  The code is below - it's completely ordinary.  Any ideas would be appreciated.  Thanks!  BTW, It fails at this line - Int32 familyId = myDataReader.GetInt32(0);  I understand I'm not checking for a return but the question is why only in this situation does it not return a value?

    protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
    {
        SqlConnection myConnection;
        SqlCommand myCommand;
        SqlDataReader myDataReader;
        string connectionString = ConfigurationManager.ConnectionStrings["Sitefinity"].ConnectionString;
        myConnection = new SqlConnection(connectionString);
        myConnection.Open();
        //prepare sql statements
        myCommand = new SqlCommand("SELECT family_id FROM family WHERE user_name = @user", myConnection);
        myCommand.Parameters.Add("@user", SqlDbType.VarChar, 30);
        myCommand.Prepare();
        myCommand.Parameters["@user"].Value = Profile.UserName;
        myDataReader = myCommand.ExecuteReader();
        myDataReader.Read();
        Int32 familyId = myDataReader.GetInt32(0);
        Session["FamilyID"] = familyId;
        myConnection.Close();
        e.KeepInInsertMode = true;
        DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
    }
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Aug 2010
    Link to this post
    Hello Shawn Davis,

    Thank you for using our services.

    Could you please share what is the error message thrown. Without it I am afraid that we would not able to suggest anything. The code by itself looks like there is nothing wrong with it.

    Regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    07 Aug 2010
    Link to this post
    It's saying the myDataReader.GetInt32(0)  is null.  Is there an easy way to the Identity column value back during ItemInserting or ItemInserted?
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    16 Aug 2010
    Link to this post
    Hi Shawn Davis,

    Where does this happens? Is this a custom Sitefinity control?

    All the best,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    21 Aug 2010
    Link to this post
    It's in a user control.  I haven't had any reports about this for a while, so I'm going to put this on the back burner.

    Thanks.
Register for webinar
5 posts, 0 answered