public void fileupladdd(string DocDesc, string Docname, string file, int doctypeid, int depid, int UserID, string UploadedBy)
{
Hashtable hash = new Hashtable();
hash.Add("@DocDesc", DocDesc);
hash.Add("@Docname", Docname);
hash.Add("@file", file);
hash.Add("@doctypeid", doctypeid);
hash.Add("@depid", depid);
hash.Add("@UserID", UserID);
hash.Add("@UploadedBy", UploadedBy);
ExecuteStoreProcedure("youspname here", hash);
}
public int ExecuteStoreProcedure(string spName, Hashtable param)
{
try
{
using (_DbConn = new SqlConnection(_sConString))
{
_DbConn.Open();
SqlCommand _DbCommand = new SqlCommand();
_DbCommand.CommandText = spName;
_DbCommand.CommandType = CommandType.StoredProcedure;
_DbCommand.Connection = _DbConn;
foreach (string para in param.Keys)
{
_DbCommand.Parameters.AddWithValue(para, param[para]);
}
return _DbCommand.ExecuteNonQuery();
}
}
catch (Exception)
{
throw;
}
}