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;
         cmd.Parameters.Add(param);
     }

    }

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

chiruthakumar

Recommended Answers

All 3 Replies

What's the error it's givving you?
Did you try the stored procedure in your sqlserver?

regards

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.