0
protected void AjaxFileUpload_img_UploadComplete(object sender, AjaxFileUploadEventArgs e)
    {

        try
        {
            if (radbtn_select.SelectedItem.Text == "Sample")
            {

                var s = e.FileName;
                int length = e.FileSize;
                byte[] imgbyte = new byte[e.FileSize];
                if (sample_code == "")
                {
                    ErrorMsg.Visible = true;
                    ErrorMsg.Text = "Sample not found.Please enter the sample code..";
                }


                cmd = new SqlCommand("sp_pdm_shopping_upload", con);
                cmd.CommandType = CommandType.StoredProcedure;
                con.Open();
                cmd.Parameters.Add(new SqlParameter("@sample", SqlDbType.Char, 15));
                SqlParameter contentparameter = null;
                contentparameter = (new SqlParameter("@image", SqlDbType.Image));
                contentparameter.Direction = ParameterDirection.Input;
                cmd.Parameters.Add(contentparameter);
                cmd.Parameters.Add(new SqlParameter("@type", SqlDbType.Char, 10));
                cmd.Parameters["@sample"].Value = txt_code.Text;
                cmd.Parameters["@image"].Value = imgbyte;
                cmd.Parameters["@type"].Value = "IMG";
                cmd.ExecuteNonQuery();
                con.Close();
                ErrorMsg.Visible = true;
                ErrorMsg.Text = "The image has been uploaded successfully.";
            }

        }
        catch
        {
            return;
        }
    }

アップロード時にテキスト ボックスの値とラジオ ボタンの値を取得しません。

どうすれば問題を解決できますか?

4

0 に答える 0