Write Query to Clear column data in SQL Server

Last Reply on Jul 08, 2012 11:32 AM By Mudassar

Posted on Jul 07, 2012 11:38 PM

hi this is my HOuse_p table

Id

Image1

Image2

behcode

1

3.jpg

 4.jpg

 1111

 

 

 

 

 

i have fileupload control and delete button in my page

 i want when users upload their file after that they can delete it from table

here when users upload file it save in image1.column i want when users click on delete button it delete imge from image1 column i wrote this sp but i dont know what should i write for image

SP

 

 

 

 

 

create procedure dbo.deleteproduct
@behcode varchar(10),
@image varchar(30)

as

begin
delete
from House_p
where behcode=@behcode and Image1=@image
end



 

CODE

 

 

 

 

    protected void Button1_Click(object sender, EventArgs e)
    {

        SqlCommand _cmd = new SqlCommand("deleteproduct", _cn);
        _cmd.CommandType = CommandType.StoredProcedure;
        
        string data = Server.UrlDecode(Request.QueryString["BehCode3"]);
        _cn.Open();
        _cmd.Parameters.AddWithValue("@Behcode", data);
        _cmd.Parameters.AddWithValue("@image",

        _cn.Close();

    }


BEst Regards

 

Posted on Jul 08, 2012 11:32 AM

That's incorrect. It got converted to hyperlink use the following

update House_pset [Date] = NULL
where behcode=@behcode and Image=@image

 

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html