hai friends,
i am writing the code for file upload .the document file is stored on the sqlserver databse.
i taken the one file upload control and button.
in the sqlserver i create a table and a procedure and witten the code.
but it gives error at show files method
please tellme the solution for that..
the code is as follows:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)

    protected void btnUpload_Click(object sender, EventArgs e)
        tdUploadStatus.InnerText = ShowFiles(1);

    private string ShowFiles(int WeekID)
         SqlParameter param = null;
         SqlConnection conn = new SqlConnection();
         conn.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial Catalog=CSMS;Integrated Security=true";
         SqlCommand cmd = new SqlCommand("showUploadedFiles", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         param = new SqlParameter("@WeekID", SqlDbType.Int, 4);
         param.Value = WeekID;


please send me ASAp.because it is urgent for me;;
thanks & regards,


8 Years
Discussion Span
Last Post by 4advanced

Did you try your stored procedure? Does it return the correct values?

Also the parameter method is deprecated....you should use AddWithValue("yourParameterName", yourParameterValue)

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.